Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8789

Re: row_number() not available for ase 12.5?

$
0
0

A little more concretely:

 

There is a special 'identity(n)' operator that you can use with select into for this purpose.  Note that while it looks like a function, it can't be used as one in a straight select, only in select into.

 

1> select row_number = identity(32), name into #mytemptable from syslogins
2> go
(10 rows affected)
1> select * from #mytemptable
2> go
row_number                          name
----------------------------------- ------------------------------
                                   1 a
                                   2 aaa
                                   3 jjj
                                   4 jjjj
                                   5 jjjjj
                                   6 joe
                                   7 joeuser
                                   8 log
                                   9 probe
                                  10 sa

(10 rows affected)
1> select name, identity(32) from syslogins
2> go
Msg 156, Level 15, State 2:
Server 'REL157SP1xx_bret_sun2', Line 1:
Incorrect syntax near the keyword 'identity'.
1>


Viewing all articles
Browse latest Browse all 8789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>