Answer the question
In order to leave comments, you need to log in
Why is SQL query returning empty?
There is a table - products in which there are many products
I request the highest model number Printer
select model, type
from product
where type = 'Printer' and model=(select max(model) from product)
Answer the question
In order to leave comments, you need to log in
At you model is a number? The aggregate function max only applies to numbers.
What does the select max(model) from product
query
return to you?
You have the maximum model selected among all products:
and it may not be a printer. And then you look for a printer with just that model. Apparently there is no such thing. select max(model) from product
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question