Wednesday, March 7, 2012

how to do this query ?

This is my table

Pid price

1 100
1 150
1 100

Output :

Pid price
1 200
1 150

ie i want to add the price where pid and price are same .

Use the following query,


Code Snippet

Select
Pid,
Price * count(*) as Price
from
YourTable
Group BY Pid,Price

No comments:

Post a Comment