Subqueries in SELECT clause

suggest change

Subqueries can also be used in the SELECT part of the outer query. The following query shows all weather table columns with the corresponding states from the cities table.

SELECT w.*,  (SELECT c.state FROM cities AS c WHERE c.name = w.city ) AS state 
FROM weather AS w;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Subqueries:
*Subqueries in SELECT clause

Table Of Contents