logo
down
shadow

SQL QUESTIONS

Exception while returning an empty Associative array from PLSQL function
Exception while returning an empty Associative array from PLSQL function
should help you out A FOR cursor loop will: Open and parse the SELECT statement fetch each row close the statement when all rows have been fetched (or upon exciting the loop).
TAG : sql
Date : December 05 2020, 12:24 PM , By : asdasd
How to create a database snapshot in SQL Server 2008 R2
How to create a database snapshot in SQL Server 2008 R2
I hope this helps you . Database Snapshot is a feature of the Enterprise Edition and the 2008 Developer Edition. Besides that there is only little use of Snapshots for a "common user". Most things can be done with a backup too.
TAG : sql
Date : December 01 2020, 04:55 PM , By : Nabillionaire17
Query speed and expressions with constant value
Query speed and expressions with constant value
like below fixes the issue it will be the same performance with a constant expression like 2*2. However if you start comparing ID/2 = 2. It will slow down the query because it has to calculate for all rows.
TAG : sql
Date : December 01 2020, 04:55 PM , By : Tzvika Shoham
How to do a complex calculation as this sample
How to do a complex calculation as this sample
I think the issue was by ths following , In order to accomplish your task you'll need to calculate a running sum and use a case statement Previously I used a JOIN to do the running sum and Lag with the case statement
TAG : sql
Date : November 29 2020, 01:01 AM , By : Jeff Jones
Passing a ResultSet into a Postgresql Function
Passing a ResultSet into a Postgresql Function
wish helps you It is not possible to pass an array of generic type RECORD to a plpgsql function which is essentially what you are trying to do.What you can do is pass in an array of a specific user defined TYPE or of a particular table row type. In t
TAG : sql
Date : November 29 2020, 01:01 AM , By : sanjay panchal
Netsuite custom formula field using a CASE statement with multiple WHEN conditions returning "invalid expression&qu
Netsuite custom formula field using a CASE statement with multiple WHEN conditions returning "invalid expression&qu
this one helps. I'm quite new to writing NetSuite sql case statements. I have been able to successfully write CASE statements with single WHEN conditions but when I include multiple WHEN conditions NetSuite returns "invalid expression" error. I am wo
TAG : sql
Date : November 28 2020, 08:01 AM , By : Teri
Execute query command (dynamic sql) runs faster than ordinary query
Execute query command (dynamic sql) runs faster than ordinary query
should help you out This could be because the second query (depending on the context of the first query) is more optimizable, since the variables become inline constants. Compare:
TAG : sql
Date : November 28 2020, 08:01 AM , By : Cristina s
How to extract only numbered rows from a column
How to extract only numbered rows from a column
Does that help For e.g: I have a column named "Card No", its a varchar but majority of the rows contain numbers and few contains alphanumeric numbers. I want to ignore all the records that are not numbers.
TAG : sql
Date : November 28 2020, 08:01 AM , By : iamfavoured
INSTEAD OF DELETE trigger (Postgresql)
INSTEAD OF DELETE trigger (Postgresql)
Hope that helps You want a BEFORE DELETE trigger whose function returns NULL and the row variable is OLD, not NEW.
TAG : sql
Date : November 28 2020, 08:01 AM , By : Alex Vargas
Oracle Apex, when a report with sql is created, how do i get it return after entering in to a text box?
Oracle Apex, when a report with sql is created, how do i get it return after entering in to a text box?
fixed the issue. Will look into that further When the user enters some search criteria and hits Enter (or clicks a button), their browser generally submits the page to the server and Apex directs them to the appropriate page as defined.In your case,
TAG : sql
Date : November 28 2020, 08:01 AM , By : Mar
Select records based on two tables where one column in one table starts with the records from another tables column usin
Select records based on two tables where one column in one table starts with the records from another tables column usin
wish helps you I have one table that contains the prefix of Job Numbers. The other table contains the complete Job number as well as several of other columns of data. I would like to return the below result using sql. , You can try to use a subquery
TAG : sql
Date : November 28 2020, 01:01 AM , By : Sandu
How to write select using two ids combination in Oracle 11g
How to write select using two ids combination in Oracle 11g
hope this fix your issue I have 2 tables and the first two columns of these two tables are identical for example: Table_1 has SSN column and membershipId column Table_2 also has SSN and membershipId column. They're identical as far as their datatypes
TAG : sql
Date : November 28 2020, 01:01 AM , By : Martin
Frequently use of 'UPDATE STATISTICS WITH FULLSCAN' is normal?
Frequently use of 'UPDATE STATISTICS WITH FULLSCAN' is normal?
hop of those help? You shouldn't have to update statistics every 15 minutes. My guess is that there's a parameter sniffing issue. A statistics update is just forcing a recompile and masks the issue until a bad parameter is cached.Do some homework on
TAG : sql
Date : November 28 2020, 01:01 AM , By : Ashwin Raman
need query for this simple pulling data sql server
need query for this simple pulling data sql server
I wish this help you I am pulling data, but how do I pull from all data listed till an specific range? , It is quite plain, use
TAG : sql
Date : November 28 2020, 01:01 AM , By : icyhairysneerer
Sql query by using decode to show grades of employee
Sql query by using decode to show grades of employee
wish of those help I have a Table "Emp" as following
TAG : sql
Date : November 28 2020, 01:01 AM , By : Josh Walsh
Not a single function error in Oracle
Not a single function error in Oracle
help you fix your problem SQL query: , Try to use this and make sure the second query doesn't return 0.
TAG : sql
Date : November 28 2020, 01:01 AM , By : Chase Maupin
Oracle SQL optimizer's behavior when dealing with ORs and row-independent predicates (such as functions returning same v
Oracle SQL optimizer's behavior when dealing with ORs and row-independent predicates (such as functions returning same v
it fixes the issue You'll need to use the undocumented hint use_concat(or_predicates(1)) or re-write the query using UNION ALL. The optimizer has problems with these types of predicates, regardless of the function. Expected Plan
TAG : sql
Date : November 27 2020, 01:01 AM , By : Harm
Combining output of two or more select statement
Combining output of two or more select statement
hop of those help? How to combine output of two or more SELECT statements, I have multiple tables which are having some data that I need to fetch them so I write multiple SELECT query. Now I want to combine result of the queries so what do I need to
TAG : sql
Date : November 27 2020, 01:01 AM , By : Joe
Must Declare Scalar Variable Exception
Must Declare Scalar Variable Exception
this will help I'm using: , You need to pass in values of your parameters:
TAG : sql
Date : November 27 2020, 01:01 AM , By : Saranuy wansuk
Postgres Calculate Difference Using Window Functions
Postgres Calculate Difference Using Window Functions
I hope this helps you . Well here is a T-SQL.For this formula as you said ---> Max(total volume each day) - Min(total volume each day)
TAG : sql
Date : November 26 2020, 01:01 AM , By : Ernest
SQL Server : unsure how to retrieve selected records
SQL Server : unsure how to retrieve selected records
may help you . In this example, can I retrieve only rows BB, DD, and FF using T-SQL syntax and a single select statement? , Give this a shot:
TAG : sql
Date : November 26 2020, 01:01 AM , By : Olbert
SQL unique field: concurrency bugs?
SQL unique field: concurrency bugs?
To fix the issue you can do Add a unique constraint on the field. That way you won't have to SELECT. You will only have to insert. The first user will succeed the second will fail.On top of that you may make the field autoincremented, so you won't ha
TAG : sql
Date : November 26 2020, 01:01 AM , By : Torsten Cordes
Query to get the next identity?
Query to get the next identity?
help you fix your problem The only way for you to reliably show an IDENTITY value on your application's form is to INSERT IT FIRST. IDENT_CURRENT might seem to help you when you're the only person testing it, but I can assure you this will fall apart
TAG : sql
Date : November 26 2020, 01:01 AM , By : Ronak
SQL Server Adding summing values based on the month
SQL Server Adding summing values based on the month
This might help you You could get your desired result given your sample data and output with:
TAG : sql
Date : November 26 2020, 01:01 AM , By : Mike
Join on month if available else join on latest month
Join on month if available else join on latest month
will help you You need the req that is valid on or before the date. Let me assume that B has a unique identifier for each row. Then you can get the corresponding row using a correlated subquery:
TAG : sql
Date : November 25 2020, 07:27 PM , By : smansou1
How to solve error: ORA-01406 fetched column value was truncated?
How to solve error: ORA-01406 fetched column value was truncated?
hope this fix your issue The Oracle docs state this about the error code:"Cause: In a host language program, a FETCH operation was forced to truncate a character string. The program buffer area for this column was not large enough to contain the enti
TAG : sql
Date : November 25 2020, 07:27 PM , By : Thomas Ha
Selecting Field Multiple Times using OR
Selecting Field Multiple Times using OR
Any of those help I want to write a query similar to this: , Use the IN syntax:
TAG : sql
Date : November 25 2020, 07:27 PM , By : Louis Reed
Which SQL datatype can be used to store mobile numbers in numeric forms, without including characters like brackets and
Which SQL datatype can be used to store mobile numbers in numeric forms, without including characters like brackets and
Hope that helps , Store the value as a string with a check constraint:
TAG : sql
Date : November 25 2020, 07:22 PM , By : Young Kim
Oracle SQL - "Not a group by expression" after adding CASE statements
Oracle SQL - "Not a group by expression" after adding CASE statements
Does that help You need to let CASE WHEN add in group by, Because CASE WHEN isn't aggregate function.
TAG : sql
Date : November 25 2020, 07:22 PM , By : Seth Parker
Runnning total of unique string values in column over days
Runnning total of unique string values in column over days
this one helps. I have an sql table of device logins that looks like: , SQL Server has window functions. So, it would seem that you could do:
TAG : sql
Date : November 25 2020, 07:22 PM , By : tony gurnick
VB.Net to AccessDB by SQL - INSERT INTO with parameters error
VB.Net to AccessDB by SQL - INSERT INTO with parameters error
wish of those help Access.OLEDB ignores parameter names; the parameters must be defined in the exact order that they appear in the command text. Since your two commands use the same parameters in a different order you'll have to use separate blocks o
TAG : sql
Date : November 25 2020, 07:22 PM , By : Josito
SQL/Excel/VBA - UPDATE query: 'Syntax Error (missing operator) in query expression'
SQL/Excel/VBA - UPDATE query: 'Syntax Error (missing operator) in query expression'
this one helps. An UPDATE query using FROM is possible in SQL Server, but not in MS Access. Use this instead:
TAG : sql
Date : November 25 2020, 07:22 PM , By : user4640494
Code to combine two sql queries
Code to combine two sql queries
help you fix your problem I want to join these two queries to get the result in one query. How do I do that? , Why do you need to seperate the queries?Try using something like
TAG : sql
Date : November 25 2020, 07:22 PM , By : Miguel Trigo
Setting SQL Date field value based off Week Number and Day Number Field
Setting SQL Date field value based off Week Number and Day Number Field
I wish this helpful for you Some things can be done with the datetime functions to calculate a date from just the week number and the weekday number. However, beware that @@DATEFIRST can be different on a server.
TAG : sql
Date : November 25 2020, 07:06 PM , By : Khalid Agriba
SQL query to find matching records but with differences in case sensitivity?
SQL query to find matching records but with differences in case sensitivity?
I wish did fix the issue. I'm trying to generate a simple query to find all records in the database (case sensitive), that have an match, but not in the same case. , You can do something using lower()/upper() function like below
TAG : sql
Date : November 25 2020, 07:06 PM , By : Haruka Kitada
How to sort record inside views in SQL Server 2008
How to sort record inside views in SQL Server 2008
hope this fix your issue Why do you need to sort a view? A view is like a table so you sort it when you select from it:
TAG : sql
Date : November 25 2020, 07:06 PM , By : Peter Halcyon
How to link the output of teradata sql query to an excel sheet?
How to link the output of teradata sql query to an excel sheet?
Hope that helps Easiest way is yo run the query from Excel via ODBC. Therefore you setup an external data source in Excel. Whenever you refresh the data, the query us executed against Teradata.In Excel 2010 it's at Data, From Other Sources, From Micr
TAG : sql
Date : November 25 2020, 07:06 PM , By : Guandepeix
Matching sets in SQL when cross-referencing
Matching sets in SQL when cross-referencing
wish helps you You want those books for whicha) there is no required tag that's missing for that book, AND b) there is no tag for that book that's not in the required tags list.
TAG : sql
Date : November 25 2020, 07:06 PM , By : Sukhi Singh
error even after following Microsoft format in SQL
error even after following Microsoft format in SQL
will be helpful for those in need You must convert EmployeeID, which is int, to varchar. Try to change your code like this:
TAG : sql
Date : November 25 2020, 01:01 AM , By : joe calafiore
Increase price by percentage, results rounded
Increase price by percentage, results rounded
With these it helps Use ROUND():
TAG : sql
Date : November 25 2020, 01:01 AM , By : xalio
Can we Use "Case" in a ColdFusion Query-of-Query
Can we Use "Case" in a ColdFusion Query-of-Query
hope this fix your issue Update:The original suggestion isn't going to work due to it only looking at a single row. Really you need to loop through your all_employees recordset and apply it to each individual row.
TAG : sql
Date : November 25 2020, 01:01 AM , By : Moko21
displaying 'Active' for a row which has 'A' as value
displaying 'Active' for a row which has 'A' as value
This might help you I have a table named course and it has two columns topic and status..
TAG : sql
Date : November 25 2020, 01:01 AM , By : Septian Hari Nugroho
Using pattern search in SQL Server Query
Using pattern search in SQL Server Query
wish helps you Is it possible to use following pattern in the Query to get the below results? , Yes this is possible with the pattern below
TAG : sql
Date : November 25 2020, 01:01 AM , By : rvp
SQL - how to group transactions for a certain date pattern?
SQL - how to group transactions for a certain date pattern?
may help you . I have a table with transactions data and want to count the number of records for each transaction_date. The date format looks like this: 2018-11-12T01:07:36.000+0000 , Trim off the time part to get the date:
TAG : sql
Date : November 24 2020, 03:41 PM , By : David Nettle
How to Index SQL with multiple AND conditions nested inside OR
How to Index SQL with multiple AND conditions nested inside OR
wish help you to fix your issue OK, a Full Table Scan (seq_scan) can actually be faster than multiple Index Scans. It depends on the specific "selectivity" of your filtering conditions.First of all your WHERE clause has six filtering conditions that
TAG : sql
Date : November 24 2020, 03:41 PM , By : Jason Ciemielewski
SQL rank with priority
SQL rank with priority
I think the issue was by ths following , I'm fully agree with TimSchmelter - you shouldn't store group in bit columns. In your current schema query could look like
TAG : sql
Date : November 24 2020, 03:41 PM , By : burnout623
Does BigQuery support SubQueries?
Does BigQuery support SubQueries?
help you fix your problem In my SQL FROM clause, I want to use a dynamically created table via a subquery: , You don't need a subquery for this:
TAG : sql
Date : November 24 2020, 03:41 PM , By : Maheshshanmuk
Any ideas for persisting H2 Database In-Memory mode transaction?
Any ideas for persisting H2 Database In-Memory mode transaction?
I wish this help you You could use the persistent mode with a large cache. With 'large' I mean so that the whole database fits in memory. That way even table scans will not read from disk.To persist an in-memory database, you could use the SCRIPT com
TAG : sql
Date : November 24 2020, 03:41 PM , By : Clarkson Photonics
How to improve SQL query performance (correlated subqueries)?
How to improve SQL query performance (correlated subqueries)?
it helps some times In most cases I prefer to use APPLY operator instead of correlated subquery. In your case I would suggest the next solution:
TAG : sql
Date : November 24 2020, 03:41 PM , By : Arunava Kundu
Filter repeated columns in Oracle
Filter repeated columns in Oracle
Does that help I want to see the same pid(or id from the person_info table) only once with the sql below. Adding "group by pid" in the end would work in MySQL but not in Oracle because I would have to have a group by for each after select. Distinct d
TAG : sql
Date : November 24 2020, 05:47 AM , By : PoiJoy
SQL Server join on whichever column has value populated
SQL Server join on whichever column has value populated
hope this fix your issue I have two tables each with the following id columns: , Ticker, SEDOL and ISIN are all different formats so I assume you need
TAG : sql
Date : November 24 2020, 05:47 AM , By : NoobLevel
use sql stored procedure to insert data which is returned from a query stored in a table
use sql stored procedure to insert data which is returned from a query stored in a table
I wish this helpful for you You may check this fiddleThe code of the Stored Procedure is:
TAG : sql
Date : November 24 2020, 05:47 AM , By : Thomas Smith
Query not working1
Query not working1
I wish did fix the issue. Joins are where you want to take more from other tables. Unions are where you want to take 2 congruent tables and show the combined resultHere is the code you need:
TAG : sql
Date : November 24 2020, 05:44 AM , By : david
SQL - using an alias in a where clause in a subquery
SQL - using an alias in a where clause in a subquery
This might help you So this isn't actually my code, but just an example of what I'm trying to do. Ideally I'd be able to use INNER JOINS and foreign key relations to get data, but I can't in my real-life situation - this is just a simple example. , Y
TAG : sql
Date : November 24 2020, 05:44 AM , By : HugoAlavez
How to search for a whole word with special char using oracle contains?
How to search for a whole word with special char using oracle contains?
should help you out According to Oracle*Text documentation non-alphabetic characters are treated as whitespace (so product$id and product_id both treated as 'product id').This behavior demonstrated at this SQLFiddle. Don't matter which non-aplhanumer
TAG : sql
Date : November 24 2020, 05:44 AM , By : חגי כהן
Production Perfomance of using SELECT * statements?
Production Perfomance of using SELECT * statements?
this will help Using SELECT * is a bad practice for a few reasons, at least in the context of SSIS. Selecting all the columns, if you don't need all of them, is a waste of memory and memory is the magic that makes SSIS run fast (or not).
TAG : sql
Date : November 24 2020, 05:44 AM , By : Adam.m
String concatenation not working as expected in SELECT statement
String concatenation not working as expected in SELECT statement
Hope this helps I'm using MS Access to work with an SQL Server database through an ODBC connection on Windows 7. , In SQL Server, is for binary masks. You want the + operator
TAG : sql
Date : November 24 2020, 05:44 AM , By : Vlad Shadrin
How to detect which stored procedures UPDATE or INSERT into a certain TABLE?
How to detect which stored procedures UPDATE or INSERT into a certain TABLE?
This might help you To start, there is no way to derive information from a stored procedure definition or its metadata that will tell you, without any doubt, that this procedure performs an insert or an update on a specific table. SQL Server just doe
TAG : sql
Date : November 24 2020, 05:44 AM , By : justwanttolearnpytho
Select statement inside CASE - SQL
Select statement inside CASE - SQL
To fix this issue You were almost there just remove the select from case statement. Since all the values are coming from same table no need of select in case statement just keep column name it will fetch the corresponding column value.
TAG : sql
Date : November 24 2020, 01:01 AM , By : chokona
.Net Float error 4 - float(4) = 4.44089209850063E-16
.Net Float error 4 - float(4) = 4.44089209850063E-16
around this issue If you are not going to change the whole application and are focused on this method, you can use Math.Round:
TAG : sql
Date : November 24 2020, 01:01 AM , By : user2957549

shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org