有一个表 table1 有两个字段 FID,Fn

24 查阅
有一个表 table1 有两个字段 FID,Fno,字都非空,写一个 SQL 语句列出该表中一个FID对应多个不同的 Fno的纪录。类如:101a1001101a1001102a1002102a100

参考答案:

正确答案:select * from table1 where FID in (select FID from table1 group by FID having (count(Distinct Fno))>=2)

字段