![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got a view, pulling fields from many tables but no one table's key is being used, so I have no unique field is there a function in sql server that will do this ? ie select a.cust, b.price, x from tblCust as a inner join tblCustPrice on a.cust = b.cust how to make 'x' be 1,2,3, etc |
#3
| |||
| |||
|
|
Roger wrote: I've got a view, pulling fields from many tables but no one table's key is being used, so I have no unique field is there a function in sql server that will do this ? ie * *select a.cust, b.price, x * * * from tblCust as a inner join tblCustPrice on a.cust = b.cust how to make 'x' be 1,2,3, etc Use the ROW_NUMBER() function. See BOL (Books Online) for examples. |
#4
| |||
| |||
|
|
I've got a view, pulling fields [sic: columns are nothing like fields] from many tables but no one table's key is being used, so I have no unique field [sic] |
![]() |
| Thread Tools | |
| Display Modes | |
| |