-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have two tables:
stories: sid, gid, title, createdate
genres: gid, genre

I want to select all of the stories and display a list grouped by
genre, like this:

genre1
    fooo
    barr

genre2
    one
    another

I can select everything with this query:

SELECT stories.sid, stories.title, stories.createdate, genres.genre
from stories
left join genres on stories.gid = genres.gid
order by genre ASC, createdate DESC

But how can I group the display? Do I have to do something completely
different, like loop over each entry in the genre table, doing a
separate query for entries that match? That seems pretty
inefficient...

c

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8 for message encryption and authentication: USE PGP!
Comment: PGP KeyID: 0x51046CFD

iQA/AwUBOcPeuNaLYehRBGz9EQKlFwCgkRuUaZtY44HgqoVpl4hG74Kb3JUAoMEy
ING2XcCu1VB/0+yvXYDnVwY7
=uvpn
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to