| Author |
Topic |
|
mike13
Posting Yak Master
219 Posts |
Posted - 2010-06-04 : 02:01:29
|
| Hi All,I want to select data, but i want it join data with same price.normal select giveproductname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,1,20,00t-shirt 3,size:m,1,20,00What i want is:productname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,2,20,00So that it adds the Quantity even if productname,productoption is different. only the Price must be the sameThanks a lot, |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-04 : 03:40:51
|
| productname,productoption,sum(quantity) as quantity,price from tablegroup by productname,productoption,priceMadhivananFailing to plan is Planning to fail |
 |
|
|
mike13
Posting Yak Master
219 Posts |
Posted - 2010-06-04 : 05:03:46
|
quote: Originally posted by madhivanan productname,productoption,sum(quantity) as quantity,price from tablegroup by productname,productoption,priceMadhivananFailing to plan is Planning to fail
Thanks a lot, that did the trick ;-) |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-06-04 : 05:14:35
|
Maybe you can do a correction in your first post?'t-shirt 3' should be 't-shirt 2' otherwise the output would beproductname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,1,20,00t-shirt 3,size:m,1,20,00and notproductname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,2,20,00 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-04 : 05:59:10
|
quote: Originally posted by webfred Maybe you can do a correction in your first post?'t-shirt 3' should be 't-shirt 2' otherwise the output would beproductname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,1,20,00t-shirt 3,size:m,1,20,00and notproductname,productoption,quantity,pricet-shirt 1,size:s,1,23,00t-shirt 2,size:m,2,20,00 No, you're never too old to Yak'n'Roll if you're too young to die.
I guessed so MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|