how to select 2 recods from a group in sqlserver
i have two table 1st is parent table and 2nd is child ,i want to select 2
records of all parent id from child table ,how can i select unique 2
records of each parent.
child table have more then one parent
example :
parent table
parent_id group_name
1 first
2 second
child table
child_id parent_id name
1 1 'test1'
2 2 'test2'
3 1 'test3'
i have already tried with statement but i found only one row from all
parent id
No comments:
Post a Comment