Comments - Subqueries in a FROM Clause

8 years, 8 months ago Olivier Bertrand

Derived tables being the result set of a command, why only select commands are accepted?

For instance an SQL query such as:

select x.key from (explain select * from t1 where id=2) as x;

returns a syntax error message.

Archived  
3 years, 5 months ago Oleksandr Byelkin

It should. Remove EXPLAIN from subquery part. EXPLAIN is an command not part of the query.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.