SQL Query Problem
-
Hi all, I need some help regarding SQL query. I have the following requirement: I have 3 tables(in bold) with columns as following: Unit UnitId ListUnit UnitId,ListId List ListId And I have the records as following in the above mentioned tables: Unit 1 2 3 ListUnit 1,1 1,3 2,1 2,2 3,2 3,1 List 1 2 3 Now I want to retrieve only top 1st (UnitId,ListId) from the group I.e. 1,2 from (1,2 1,1 1,3) group. Then 2,1 from (2,1 2,2) group. And 3,2 from (3,2 3,1) group. So how could I write SQL Query for this? Thanks, Rachit Damani.
-
Hi all, I need some help regarding SQL query. I have the following requirement: I have 3 tables(in bold) with columns as following: Unit UnitId ListUnit UnitId,ListId List ListId And I have the records as following in the above mentioned tables: Unit 1 2 3 ListUnit 1,1 1,3 2,1 2,2 3,2 3,1 List 1 2 3 Now I want to retrieve only top 1st (UnitId,ListId) from the group I.e. 1,2 from (1,2 1,1 1,3) group. Then 2,1 from (2,1 2,2) group. And 3,2 from (3,2 3,1) group. So how could I write SQL Query for this? Thanks, Rachit Damani.