[thelist] Selecting two distincts

Joel Canfield joel at spinhead.com
Sun May 5 21:49:01 CDT 2002


How could this be combined into one query? Would it be best to leave it as
two separate queries?

SELECT DISTINCT(g.GenreName)
FROM loggenretlk as lg
JOIN
genre as g
ON g.GenreID = lg.GenreID
JOIN weblog as w
ON w.LogID = lg.LogID
WHERE w.LogID = @LogID

SELECT DISTINCT(b.BandName)
FROM logbandtlk as lb
JOIN
bands as b
ON b.BandID = lb.BandID
JOIN weblog as w
ON w.LogID = lb.LogID
WHERE w.LogID = @LogID

Tenks

joel



More information about the thelist mailing list