Skip to content
Advertisement

Firebird how to use IIF in ORDER BY with a subquery’s column

The following query doesn’t work, because Firebird (2.1) won’t recognize the subquery’s column. How can I rewrite it to work?

Advertisement

Answer

Use a subquery:

I would also recommend using COALESCE() in the ORDER BY:

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