Top "Correlated-subquery" questions

Correlated sub-query is a sub-query (a query nested inside another query) that uses values from the outer query.

Difference between Subquery and Correlated Subquery

Is the following piece of SQL Query a normal query or a Correlated Subquery ?? SELECT UserID, FirstName, LastName, DOB, GFName, …

sql sql-server subquery correlated-subquery
SQL Server "cannot perform an aggregate function on an expression containing an aggregate or a subquery", but Sybase can

This issue has been discussed before, but none of the answers address my specific problem because I am dealing with …

sql sql-server aggregate correlated-subquery
Find All Rows With Null Value(s) in Any Column

I'm trying to create a query that will return all the rows that have a null value across all but 1 …

sql sql-server sql-server-2005 null correlated-subquery
MySQL/SQL: Update with correlated subquery from the updated table itself

I have a generic question that I will try to explain using an example. Say I have a table with …

mysql sql sql-update correlated-subquery
DELETE SQL with correlated subquery for table with 42 million rows?

I have a table cats with 42,795,120 rows. Apparently this is a lot of rows. So when I do: /* owner_cats …

sql sql-server sql-delete correlated-subquery
Using SQL to compare counts of identifiers from two tables

I'm trying to construct a query that compares two tables with identical structure Table 1: ID | Data Table 2: ID | Data ID …

mysql sql subquery correlated-subquery
SQL - Relationship between a SubQuery and an Outer Table

Problem I need to better understand the rules about when I can reference an outer table in a subquery and …

sql subquery correlated-subquery derived-table inline-view
SQL update from one Table to another based on a ID match IN db2

The Query below is suited in SQL sErver. But in DB2 it does not give results: Error is SQLCODE = -199, …

db2 sql-update db2-luw correlated-subquery
JPA Criteria select all instances with max values in their groups

Is there a way to write with JPA 2 CriteriaBuilder the equivalent of the following query? select * from season s1 where …

jpa jpa-2.0 criteria-api correlated-subquery
How do I get the oldest date without using a correlated subquery in SQL?

The following code list all the invoices, and I just want the oldest invoice from a vendor: SELECT DISTINCT vendor_…

sql oracle greatest-n-per-group correlated-subquery