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 Developer – Difference Snippet VS Code Template

Snippet Code Vorlagen 1

In principle, Snippet and Code Template serve the same purpose: Previously created code is inserted at the desired location. The only difference between the two tools is the paste option. Snippets require the Snippets window first. This can be dragged to any location in the SQL Developer. In addition, the snippets are divided into different … 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