Re: Last not null value from previous rows
From: Shakespeare <whatsin_at_xs4all.nl>
Date: Tue, 26 Jan 2010 22:32:02 +0100
Message-ID: <4b5f5f51$0$22940$e4fe514c_at_news.xs4all.nl>
Op 26-1-2010 20:56, Michel Cadot schreef:
> "Shakespeare"<whatsin_at_xs4all.nl> a écrit dans le message de news: 4b5f4717$0$22934$e4fe514c_at_news.xs4all.nl...
> |I vaguely remember this has been asked and answered before, but can not
> | find the answer anymore:
> | Suppose I have a table in which a column has a value for some rows, and
> | none (null) for others. Is there a way to let a select statement (which
> | returns values from the current row) return the last non null value for
> | this column? So, in pseudo code:
> |
> | select
> | col1,
> | col2,
> | "last-non-null value for col3"
> | from a_table
> | order by col1?
> |
> |
> | Thanks in advance,
> |
> | Shakespeare
>
> What about LAST_VALUE function?
>
> Regards
> Michel
>
>
Thanks Michel,
Date: Tue, 26 Jan 2010 22:32:02 +0100
Message-ID: <4b5f5f51$0$22940$e4fe514c_at_news.xs4all.nl>
Op 26-1-2010 20:56, Michel Cadot schreef:
> "Shakespeare"<whatsin_at_xs4all.nl> a écrit dans le message de news: 4b5f4717$0$22934$e4fe514c_at_news.xs4all.nl...
> |I vaguely remember this has been asked and answered before, but can not
> | find the answer anymore:
> | Suppose I have a table in which a column has a value for some rows, and
> | none (null) for others. Is there a way to let a select statement (which
> | returns values from the current row) return the last non null value for
> | this column? So, in pseudo code:
> |
> | select
> | col1,
> | col2,
> | "last-non-null value for col3"
> | from a_table
> | order by col1?
> |
> |
> | Thanks in advance,
> |
> | Shakespeare
>
> What about LAST_VALUE function?
>
> Regards
> Michel
>
>
Thanks Michel,
that was the one I was looking for!
Shakespeare Received on Tue Jan 26 2010 - 15:32:02 CST