You are here: Re: ORDER BY CASE « MsSQL Server « IT news, forums, messages
Re: ORDER BY CASE

Posted by Tony Rogerson on 12/23/06 22:32

>A quick lesson in good software engineering and SQL: Put the sort key
> into a column in your result SELECT list and give it a name.
>
> 1) Good SQL: Using an expression in an ORDER BY clause is a
> proprietary "feature" in SQL Server and not Standard SQL. The ORDER BY
> caluse is alawyas part of a cursor, not a SELECT statement, since
> DSELECT produces a table which has no order by definition.
>
> 2) Good S.E.:Always show what you used to sort a result set to the next
> tier of the architecture. They might need to use it. Hey, the final
> user might fidn data easier to find on his display if it was there!
>

That is a mistake class room coders often make; they don't take into
consideration the extra resource the extra columns require when say
bandwidth may be a limiting factor to scalability.

Why pass something you don't need?

This is a MICROSOFT SQL SERVER news group (you may do well to remember that)
and NOT a STANDARD SQL one - as far as I know no such group exists which
suggests there is not much call for it.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials


"--CELKO--" <jcelko212@earthlink.net> wrote in message
news:1166906010.557020.127250@79g2000cws.googlegroups.com...
>A quick lesson in good software engineering and SQL: Put the sort key
> into a column in your result SELECT list and give it a name.
>
> 1) Good SQL: Using an expression in an ORDER BY clause is a
> proprietary "feature" in SQL Server and not Standard SQL. The ORDER BY
> caluse is alawyas part of a cursor, not a SELECT statement, since
> DSELECT produces a table which has no order by definition.
>
> 2) Good S.E.:Always show what you used to sort a result set to the next
> tier of the architecture. They might need to use it. Hey, the final
> user might fidn data easier to find on his display if it was there!
>

 

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

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