Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to sort against last qty added in sql server 2005 table

$
0
0

i am using sql select query to select record and show in gridview  but I am facing sorting problem. I want to select query must be sort DESC (means last inserted record or against last edited row)

here is my query but cannot give me desired result

SELECT     Barcode, ProductID, ProductName, SUM(Qty) AS Qty, MAX(Price) AS Price, SUM(Total) AS Total
FROM         TempInv
WHERE     (CSNo = 'CS-0000008')
GROUP BY Barcode, ProductID, ProductName
ORDER BY ProductID DESC, Qty DESC


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>