0

I'd like to have a column ROWNUM in my result when I select from multiple tables. Is this possible? How can I do that?

My query is something like :

select rownum, xx,zzz,aaa,aaa  
from table1, table2, table3  
where condition1  
     and condition2  
     and condition3  
Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
curvenut
  • 75
  • 1
  • 11

1 Answers1

0

Yes, it is possible . use the T-SQL ROW_NUMBER function.

As described here.

Otherwise you can achive this , without using the function like here : sql-rownum-how-to-return-rows-between-a-specific-range

Community
  • 1
  • 1
Itzik Gili
  • 284
  • 3
  • 16