gcapp
12-02-2002, 04:34 PM
Can someone tell me what command to use in an sql statement if I have a table that has a field that I want to group records on.
My example is a have a table with a field called District and there are records that have District 1, District 2, etc. in them. I'd like to group on District 1 and have the names of the people list under that group and then have it ordered by District 1, 2, 3, etc.
My table records are like this:
DISTRICT NAME PARTY
District 1 John Doe Republican
District 1 Joe Shmoe Democrat
District 4 John Deer Republican
I'd like the results to look like:
District 1
John Doe
Joe Shmoe
District 4
John Deer
I tried this sql statement, but it doesn't work:
"SELECT * FROM Legislature GROUP ON District ORDER BY District ASC;"
Can someone help??
Thanks,
Gary
My example is a have a table with a field called District and there are records that have District 1, District 2, etc. in them. I'd like to group on District 1 and have the names of the people list under that group and then have it ordered by District 1, 2, 3, etc.
My table records are like this:
DISTRICT NAME PARTY
District 1 John Doe Republican
District 1 Joe Shmoe Democrat
District 4 John Deer Republican
I'd like the results to look like:
District 1
John Doe
Joe Shmoe
District 4
John Deer
I tried this sql statement, but it doesn't work:
"SELECT * FROM Legislature GROUP ON District ORDER BY District ASC;"
Can someone help??
Thanks,
Gary