There are several tables in DB:
Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, price, screen)
Printer(code, model, color, type, price)
and I need to find
Find the model number of the product (PC, laptop, or printer) with the highest price. Result set: model.
I managed to write the following query:
select model from
(select model, price from PC
union
select model, price from Laptop
union
select model, price from Printer) G
and now I need to plot the model/models from set G, wich have a max price
I can easily select a max price by adding to select clause - max(G.price), but i need models and only models...
what syntax would be right?
thank you in advance!
UNIONand notUNION ALL?