Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
paramu
Posting Yak Master
151 Posts |
Posted - 2009-07-02 : 02:15:29
|
| I have a select Query, but I want to add the row-number as serial_number, is it possible?select row_number??? as sl_no,mprmst.mpr_no,mprmst.itm_code,itemmst.itm_description,mprmst.itm_specify,mprmst.Itm_qty from mprmst,itemmst where mprmst.mpr_no='1344' and itemmst.itm_code=mprmst.itm_codeThanks |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-02 : 02:17:36
|
| select row_number() OVER(order by mpr_no) as sl_no,mprmst.mpr_no,mprmst.itm_code,itemmst.itm_description,mprmst.itm_specify,mprmst.Itm_qty from mprmst,itemmst where mprmst.mpr_no='1344' and itemmst.itm_code=mprmst.itm_code |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-07-02 : 02:18:36
|
| Yes it is possible, on what column basis to partitionEg;-row_number() over ( partition by column order by column) |
 |
|
|
paramu
Posting Yak Master
151 Posts |
Posted - 2009-07-02 : 05:15:12
|
| Both BKLR & NAGESHWAR are doing good services, Really appreciatedParamu @ PARANTHAMAN |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-02 : 05:19:36
|
| welcome |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|