You are here: Re: How To Return A "Range Of Rows"?? « MsSQL Server « IT news, forums, messages
Re: How To Return A "Range Of Rows"??

Posted by pbd22 on 04/13/07 23:18

On Apr 12, 6:50 pm, Ed Murphy <emurph...@socal.rr.com> wrote:
> 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?

good point Ed. I didn't think of that. I'll obviously have to do that
- yet
another thing on the "to-do list". thanks...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация