假设我在 MySQL 表中有 3 个表,其中包含以下字段。
产品
product_id
product_name
类别
category_id
category_name
product_in_category
product_in_category_id
product_id
category_id
您建议使用什么查询来获取当前未分配给“product_in_category”表中某个类别的所有产品的列表?
性能非常重要,这些表很大。
最佳答案
select a.* from product a
left join product_in_category b on a.product_id = b.product_id
where b.product_id is null
关于sql - 你将如何执行此 SQL 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3927419/