आप ROW_NUMBER()
. का उपयोग कर सकते हैं इस तरह कार्य करें:
SELECT *
FROM(SELECT workflowid, salesRepId, quantityAssigned,
quantityLeft, month, year
, ROW_NUMBER()
OVER (PARTITION BY salesRepId
ORDER BY workflowid) AS rownumber
FROM sm_salesRepWorkflow)
WHERE rownumber = 1;
फिडल डेमो