Global web icon
stackoverflow.com
https://stackoverflow.com/questions/1406215/sql-se…
SQL "select where not in subquery" returns no results
SQL "select where not in subquery" returns no results Asked 16 years, 2 months ago Modified 9 months ago Viewed 492k times
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/173041/not-in-…
sql - NOT IN vs NOT EXISTS - Stack Overflow
The subquery inside the NOT IN statement can be evaluated at the beginning of the execution, and the temporary table can be checked against each value in the outer select, rather than re-running the subselect every time as would be required with the NOT EXISTS statement.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/5846882/how-do…
How do SQL EXISTS statements work? - Stack Overflow
118 I'm trying to learn SQL and am having a hard time understanding EXISTS statements. I came across this quote about "exists" and don't understand something: Using the exists operator, your subquery can return zero, one, or many rows, and the condition simply checks whether the subquery returned any rows.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/2653188/sql-se…
SQL Server Subquery returned more than 1 value. This is not permitted ...
This subquery returns multiple values, SQL is complaining because it can't assign multiple values to cost in a single record. Some ideas: Fix the data such that the existing subquery returns only 1 record Fix the subquery such that it only returns one record Add a top 1 and order by to the subquery (nasty solution that DBAs hate - but it "works")
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/14618703/updat…
Update query using Subquery in Sql Server - Stack Overflow
Update query using Subquery in Sql Server Asked 12 years, 10 months ago Modified 5 years, 9 months ago Viewed 440k times
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/11169550/is-th…
sql - Is there a performance difference between CTE , Sub-Query ...
SQL is a declarative language, not a procedural language. That is, you construct a SQL statement to describe the results that you want. You are not telling the SQL engine how to do the work. As a general rule, it is a good idea to let the SQL engine and SQL optimizer find the best query plan. There are many person-years of effort that go into developing a SQL engine, so let the engineers do ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/3856164/which-…
sql - Which of the join and subquery queries would be faster and why ...
I have serious doubt on this answer, since most DBMS, definitely SQL Server 2008 and later, translate the single ID subquery (not correlated, meaning: not referencing multiple outer query columns) into a relatively fast semi-join.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/12552288/sql-w…
SQL WITH clause example - Stack Overflow
The SQL WITH clause was introduced by Oracle in the Oracle 9i release 2 database. The SQL WITH clause allows you to give a sub-query block a name (a process also called sub-query refactoring), which can be referenced in several places within the main SQL query.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/17268848/diffe…
sql - Difference between Subquery and Correlated Subquery - Stack Overflow
A Correlated subquery is a subquery that is evaluated once for each row processed by the outer query or main query. Execute the Inner query based on the value fetched by the Outer query all the values returned by the main query are matched.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/4629979/nested…
Nested select statement in SQL Server - Stack Overflow
We need to make an alias of the subquery because a query needs a table object which we will get from making an alias for the subquery. Conceptually, the subquery results are substituted into the outer query. As we need a table object in the outer query, we need to make an alias of the inner query.