【发布时间】:2013-09-09 13:19:33
【问题描述】:
我有两个表:第一个是父表,第二个是子表。我想从子表中选择所有父 id 的 2 条记录。
如何选择每个父母的唯一 2 条记录。
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'
我已经尝试过 with 语句,但我发现所有父 ID 中只有一行
【问题讨论】:
标签: sql-server linq