You are here: Re: How to find first not null value in column « MsSQL Server « IT news, forums, messages
Re: How to find first not null value in column

Posted by Hugo Kornelis on 10/01/05 11:38

On 28 Jan 2006 11:51:33 -0800, --CELKO-- wrote:

>>> How to find first not null value in column without chacking whole table <<
(snip)
>Let's make a guess, based on nothing you posted, as to what the DDL
>looks like:
>
>CREATE TABLE Foobar
>(foo_key INTEGER NOT NULL PRIMARY KEY, -- order by him??
> klugger INTEGER, -- target column ??
> ..);
>
>SELECT foo_key
> FROM Foobar
> WHERE klugger IS NULL
> AND foo_key
> = (SELECT MIN(foo_key) FROM Foobar);

HHi Joe,

I do hope that you actually intended to post

SELECT MIN(foo_key)
FROM Foobar
WHERE klugger IS NULL

--
Hugo Kornelis, SQL Server MVP

 

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

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