[thelist] Tricky SQL
rudy
r937 at interlog.com
Tue Jun 18 14:22:06 CDT 2002
> "SELECT score FROM * WHERE gameDate = yesterday" to get
> all scores for all games played by all teams in all sports for yesterday.
presumably you want to search all tables, so use a union
SELECT 'mens', score FROM soccer_mens
WHERE gameDate = yesterday" to get
UNION ALL
SELECT 'womens', score FROM soccer_womens
WHERE gameDate = yesterday" to get
UNION ALL
et cetera
the literal in the result set tells you which table the row came from
rudy
More information about the thelist
mailing list