3条回答 默认 最新
- 战在春秋 2017-04-04 06:34关注
假设表名为Persons。
可用如下sql语句
select distinct id from Persons where id not in (select id from Persons where num = 3);
备注:不加distinct,结果为3 3
加distinct,结果为3 ![图片说明](https://img-ask.csdn.net/upload/201704/04/1491287404_342943.png)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报