Hi,
how to use top with join in sqlserver ?
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
Gowtham RajamanickamRank #57 · 29K reputationPosted May 13, 2015, 2:45 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted May 13, 2015, 2:46 AM EDT
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 13, 2015, 2:47 AM EDT
Select top 1 a.* from table1 a, table2 b where a.idcolumn=b.idcolumn order by the relavant_column this is sample code to using top clause in sqlPankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted May 13, 2015, 4:15 AM EDT
select top(1) student.sname , Marks.marks from student
left outer join
Marks
on
student.sid=Marks.sid
here i use the top command with join you can use any type of join like left,right ,inner join as per your requirment....