Return a value if no rows are found SQL

SQL

What actually happens when you run a SQL query that doesn’t return any rows? For example, think of a WHERE clause with the condition 1=2, which can never be fulfilled and therefore rows can never be returned. First, let’s look at a few examples that should show you what you can expect as a return … Read more

SQL Default Value if no row is returned

SQL

Sometimes default values are necassary. Normally you can use NVL or NVL2 when you get NULL values as return value. But it is also possible, that no row is returned. In this case, NVL or NVL2 is not working, cause you get no value back – not even NULL. Therefore, there are some options – … Read more