Skip to content
Advertisement

How do I make aggregate query return empty set instead of NULL row?

I have a SQL query like this:

However, when t2 selection is empty, it returns a row containing NULL values (because of MAX function returning NULL when called on an empty set). I would like it to return an empty set instead. How can I achieve it?

Advertisement

Answer

Try this in sql server …

try this in Mysql

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement