Re: How to find first not null value in column
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 28 Jan 2006 22:55:05 +0100
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
.
- Follow-Ups:
- Re: How to find first not null value in column
- From: --CELKO--
- Re: How to find first not null value in column
- References:
- How to find first not null value in column
- From: Martin R
- Re: How to find first not null value in column
- From: --CELKO--
- How to find first not null value in column
- Prev by Date: Re: SQL Server client tools
- Next by Date: Re: SQL Server does not exist or access denied
- Previous by thread: Re: How to find first not null value in column
- Next by thread: Re: How to find first not null value in column
- Index(es):
Relevant Pages
|
|