MySQL Correlated sub-query
-
I’m trying to do a correlated sub-query that works great in MySQL, but wpdatatables is throughing up an error. Here is the query:
SELECT count(*) AS TOTAL_SPONSORS, (SELECT count(*) FROM table1 as p WHERE NOT EXISTS (SELECT t.sponsor_slug FROM table2 as t where t.sponsor_slug = p.sponsor_slug)) AS EMPTY_TABLES, (SELECT count(*) FROM table1 as p WHERE EXISTS (SELECT t.sponsor_slug FROM table2 as t where t.sponsor_slug = p.sponsor_slug)) AS FILLED_TABLES FROM table1The error is:
unknown [expr_type] = reserved in “WHERE” [1]This query is valid and work fine in MySQL from the command line or via phpMyAdmin.
Any thoughts?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘MySQL Correlated sub-query’ is closed to new replies.