exists用法
exists指定一个子查询,用于检查行的存在,exists子查询实际上不返回任何数据,而返回值为false或者true
例如
检查物品是否有订单,显示名字(有主外键关系)
select 名字from 物品表名 c where exists(select *from订单表名where c.id=id )
2020-10-02
最新推荐文章于 2020-10-13 17:07:05 发布
exists用法
exists指定一个子查询,用于检查行的存在,exists子查询实际上不返回任何数据,而返回值为false或者true
例如
检查物品是否有订单,显示名字(有主外键关系)
select 名字from 物品表名 c where exists(select *from订单表名where c.id=id )