i want to select top 3 values from a table where a particular column should have distinct values only..
how to write the stored procedure in such case??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rafnas T PRank #280 · 8.8K reputationPosted Feb 6, 2017, 9:14 PM EST
ROW_NUMBER() OVER (PARTITION BY [column name having duplicate values] ORDER BY id) AS RowNumber
FROM tableName
) AS a
WHERE a.RowNumber = 1