About 1,650,000 results
Open links in new tab
  1. SQL "select where not in subquery" returns no results

    Sep 10, 2009 · The long answer (From T-SQL Fundamentals, Third edition, by Itzik Ben-Gan) This is an example: Imagine there is a order with a NULL orderid inside Sales.Orders table, so the subquery …

  2. 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, 10 months ago Viewed 440k times

  3. 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 …

  4. SQL Server Subquery returned more than 1 value. This is not permitted ...

    Apr 16, 2010 · 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 …

  5. 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 …

  6. sql - Difference between Subquery and Correlated Subquery - Stack …

    Jun 24, 2013 · 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 …

  7. 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 …

  8. SQL WITH clause example - Stack Overflow

    Sep 23, 2012 · 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 …

  9. sql - Is there a performance difference between CTE , Sub-Query ...

    Jun 23, 2012 · 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 …

  10. sql - Difference between CTE and SubQuery? - Stack Overflow

    IMO, anyone who thinks a CTE is less readable that a gigantic blob of interwoven subqueries hasn't seen the garbage pile of confusing saw-teeth-shaped queries in use across the majority of enterprise …