#exit型子查询
把外层的查询结果,拿到内层,看内层的查询是否成立.

select * from category;

mysql--(入门语句19--exit型子查询)

select goods_id,cat_id,goods_name from goods;


#查有商品的栏目
select cat_id,cat_name from category where exits (select *from goods where goods.cat_id=category.cat_id);

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2021-10-27
  • 2021-08-03
猜你喜欢
  • 2021-08-05
  • 2021-12-05
  • 2021-12-05
  • 2022-12-23
  • 2021-12-05
  • 2021-08-14
相关资源
相似解决方案