Vote count:
0
I have this table
I want to group it like
ProductID Purchased Sold
------------------------------------
1 235 0.00
2 125 0.00
3 55 24.00
Here Purchased = (IsCreditor = 0)
I tried this
SELECT
ProductID,
Max (TotalQty) As Purchased,
Min(TotalQty) As Sold
FROM
TestTable
GROUP BY
ProductID
It will work only if a product have both IsCreditor = 0 and IsCreditor = 1
asked 27 secs ago
Need help on grouping this SQL table
Aucun commentaire:
Enregistrer un commentaire