我正在尝试解决 sql-ex.com 中的 6 号任务,但我已经卡住了。
接下来的问题是:
对于生产硬盘容量为 10 Gb 或更高的笔记本电脑的每个制造商,请找出此类笔记本电脑的速度。结果集:制造商、速度。 数据库方案由四个表组成:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)
这是我当前的代码:
select Product.maker, speed from Laptop left join Product
on Laptop.model=Product.model
where hd>=10
这是不正确的。
最佳答案
它应该包含 DISTINCT:
select DISTINCT Product.maker, speed from Laptop left join Product
on Laptop.model=Product.model
where hd>=10
关于mysql - SQL 从多个表中选择 sql-ex 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33939599/