Subject | Re: [firebird-support] Serial number in a query result |
---|---|
Author | Mike Pomraning |
Post date | 2011-03-24T13:41:28Z |
On Thu, Mar 24, 2011 at 2:06 AM, Thomas Steinmaurer <ts@...>wrote:
dataset?" http://www.firebirdfaq.org/faq343/
A throw-away SEQUENCE would also do the trick, I think:
sql> create sequence AdHoc;
sql> select next value for AdHoc as SrNo, d.* FROM (...) d;
-Mike
[Non-text portions of this message have been removed]
>That trickiness appears in the FAQ: "How to get record number as part of
>
> > I searched through the net and found MS Sql server has something like
> this
> >
> > select ROW_NUMBER()OVER(ORDERBY ColumnName1) AsSrNo
> >
> > I just want to know whether anything like this is available in firebird.
>
> Window functions including the OVER clause etc. will be supported in
> Firebird 3. I think the only way to do this currently is to write a
> selectable stored procedure. Perhaps some tricky RDB$GET_CONTEXT /
> RDB$SET_CONTEXT mix can simulate this too.
>
dataset?" http://www.firebirdfaq.org/faq343/
A throw-away SEQUENCE would also do the trick, I think:
sql> create sequence AdHoc;
sql> select next value for AdHoc as SrNo, d.* FROM (...) d;
-Mike
[Non-text portions of this message have been removed]