Reply to Re: How to find first not null value in column

Your name:

Reply:


Posted by Hugo Kornelis on 02/01/06 00:21

On 30 Jan 2006 19:57:03 -0800, Doug wrote:

>
>>> I've used cursors all the time without an order by function.my bad. <<
>
>
>>That will give you random results, based on the internal state of the
>database at the time of the query.
>
>Really???? Wow. Could you point me to the documentation that states
>that you will get a different set of data for your cursor if you don't
>use an order by statement?
>
>So which is it? Are we set based, or are we "set based, but sets are
>different depending on whether they are in order and in a cursor."

Hi Doug,

We are set based. And a set in a relational database is a collection of
rows with no implied order.

A cursor is not a set - it is an operation to turn a set into a series
of rows, with implied order. If you use ORDER BY in the DECLARE CURSOR
statement, the order of the rows in the cursor is defined. Without an
ORDER BY, the optimizer is free to choose an order in which the rows
will be fed to the cursor. And there is no guarantee that the same order
will be used the next time you execute the same statement.

--
Hugo Kornelis, SQL Server MVP

[Back to original 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

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