Subqueries in SELECT clause
suggest changeSubqueries 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;
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents