id combo
1 1
2 2
3 2
4 1
in this table i want only min id value for same cobmo,for example from the above table combo's are 1 and 2 i want only 2nd combo within 2nd combo i want only min id
Know the answer? Post it. Somebody with the same question will find it here.



In SQL:
SELECT MIN(id) As MinId
FROM tblTemp
WHERE combo = 2
GROUP BY combo;
In LINQ:
int minId = (from p in records
group p by p.combo into g
where p.combo = 2
select new { combo = g.key, minid = g.id.Min() }).SingleOrDefault().minid;
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
Ananth GRank #1,176 · 1.5K reputationPosted Oct 24, 2016, 8:47 PM EDT