Page 1 of 1
Sorting rows alphabetically ?
Posted: Fri Jun 13, 2003 5:49 am
by Czar
Just need a query to sort results alphabetically...
SELECT * FROM wpn ORDER BY ?????...
Thanks.
Posted: Fri Jun 13, 2003 5:54 am
by twigletmac
You need to choose which field you want to sort on, for example:
Code: Select all
SELECT first_name, last_name, address, tel_no, email FROM users ORDER BY last_name, first_name
Mac
Posted: Fri Jun 13, 2003 5:56 am
by discobean
SELECT fieldname1, fieldname2, fieldname3 FROM tablename ORDER BY fieldname1
I would avoid using SELECT * but it dosn't really matter... some db's are faster if u do *, some are slower apparently..
Posted: Fri Jun 13, 2003 6:01 am
by Czar
Well yeah.. it was a little bit more complex thing than i wrote. Sorry for inconvenience, didn't express myself as i meant to. I had to rearrange result arrays too and grouped em by one more var from db. But did it anyway...
Keep up the GW.
Posted: Fri Jun 13, 2003 6:02 am
by cactus
Speed of databases is related to hardware, optimisation, amount of data, database schema, and query tuning to name a few.
Using "SELECT * FROM blah" on a database with a million or so rows and no index would be a little slow, to say the least, and probably halt the server!
Regards,