将一个表中有一列为fatherID,小弟我想把fatherID相同的数据作为一个临时表输出。输出过个表

将一个表中有一列为fatherID,我想把fatherID相同的数据作为一个临时表输出。输出过个表。将一个表中有一列为

将一个表中有一列为fatherID,我想把fatherID相同的数据作为一个临时表输出。输出过个表。
将一个表中有一列为fatherID,我想把fatherID相同的数据作为一个临时表输出。输出过个表。

[解决办法]
给出具体测试数据和结果
[解决办法]

探讨
将一个表中有一列为fatherID,我想把fatherID相同的数据作为一个临时表输出。输出过个表。

[解决办法]
SQL code
select *from tbwhere fatherid in (    select fatherid    from tb    group by fatherid    having count(*) > 1)
[解决办法]
SQL code
--存在主键字段,假设为Idselect *from tb twhere exists (select 1 from tb where fatherid=t.fatherid and id<>t.id)