|
Posted by Ed Murphy on 04/13/07 01:50
pbd22 wrote:
> select coalesce (tab1.postalAddress, tab2.name, tab3.postaladdress,
> tab4.postaladdress) id , tab1.bdayday , tab1.bdaymonth ,
> tab1.bdayyear , tab1.sex , tab1.zipCode , tab1.siteId , tab1.userID ,
> tab2.photolocation , tab2.photoname , tab2.photodefault ,
> tab2.nophoto , tab3.headline , tab3.aboutme , tab4.signindate from
Why the hell doesn't anyone format their queries for readability?
> order by CASE WHEN userID=67 THEN 1 WHEN userID=103
> THEN 2 WHEN userID=102 THEN 3 WHEN userID=81 THEN 4 WHEN userID=94
> THEN 5 WHEN userID=87 THEN 6 WHEN userID=104 THEN 7 WHEN userID=82
> THEN 8 WHEN userID=54 THEN 9 WHEN userID=64 THEN 10 WHEN userID=63
> THEN 11 WHEN userID=6 THEN 12 WHEN userID=58 THEN 13 WHEN userID=100
This should be driven by a Users table. Do you really want to mess
around with altering the query every time a user is added/removed?
[Back to original message]
|