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 |
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-04-12 : 00:53:59
|
i have total pax of 5.1 pax can buy multiple items.how can i maintain the pax to 5?pax item1 A1 B1 C1 D1 Eresult should be:totalPax Item ID5 A 111 B 111 C 111 D 111 E 111 |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-12 : 01:11:23
|
SELECT *, COUNT(Item) OVER(PARTITION BY Pax)FROM @pax |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-12 : 04:36:25
|
what happened to B,C etc? why they dont have any value for totalpax?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|