gpt4 book ai didi

MySQL 触发器。需要示例答案

转载 作者:可可西里 更新时间:2023-11-01 07:35:46 24 4
gpt4 key购买 nike

我正在尝试寻找只生产笔记本电脑而不生产 PC 的产品制造商

Relations:
Product(maker, model, type)
Laptop(Model, price, speed, ram, hd, screen)
PC(model, price, speed, ram, hd)
Printer(model,price, color, price)

我尝试过的

 (SELECT maker, type 
FROM product WHERE type = 'laptop')
DIFFERENCE
(SELECT maker, type
FROM product WHERE type = 'pc');

我想在MySQL中运行没有区别吧?

最佳答案

SELECT 
p1.maker,
p1.type
FROM
product p1
LEFT JOIN product p2 ON p2.maker = p1.maker AND p2.type = 'pc'
WHERE
p1.type = 'laptop'
p2.maker IS NULL

关于MySQL 触发器。需要示例答案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10001939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com