Questions tagged [mysql-dependent-subquery]

Use this tag for questions related to a dependent (correlated) subquery in MySQL.

A correlated subquery is a subquery that contains a reference to a table that also appears in the outer query.

as stated in MySQL: 13.2.10.7 Correlated Subqueries.

Question tagged with talk about optimization and performance issues with this kind of queries, in addition to getting them right, etc. .

31 questions
-2
votes
1 answer

MySQL query to return 1 and 0 based on difference between dates

In MySQL Database I have a table ABC that consists of a column 'LastDate'. LastDate which has datatype as DATETIME. The default value for this 'NULL' I need to write a query for the table which would Return '1' in these cases. 1) If…
1 2
3