关系:
Product(maker, model, type)
Laptop(Model, price, speed, ram, hd, screen)
PC(model, price, speed, ram, hd)
Printer(model,price, color, price)
我试图找到价格最高的产品型号。
我试过的:
-> SELECT model, MAX(price) FROM
-> ((SELECT model, MAX(price) FROM product NATURAL JOIN pc)
-> union
-> (SELECT model, MAX(price) FROM product NATURAL JOIN printer)
-> union
-> (SELECT model, MAX(price) FROM product NATURAL JOIN laptop));
我不断收到的错误是“ERROR 1054 (42S22): Unknown column 'price' in 'field list'”