繁体   English   中英

SQL从多个表中选择SQL-EX 6

[英]SQL select from multiple tables sql-ex 6

我正在尝试从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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM