Skip to content

Comparing two empty Strings in Oracle SQL

Hi today I have met with weird situation. I had a where clause where was condition which returns String and I wanted to check if it’s empty or not. And when it returns empty string Oracle still treat …

Group timestamp by hour SQLite

I am trying to group my timestamp column which has a data type of TimeStamp by hour. So this works for grouping by day: I have tried the following for grouping by hour: But this gives me the error: no such function: HOUR: I have seen similar questions asked, but it was DateTime used, not TimeStamp. Additional…

Oracle: SELECT value from where clause as dummy table

after a lot of searching I unfortunately couldn’t find a solution for the following task: I need an Oracle-SQL-Query that returns the value from the WHERE-clause as the result value. This sounds easy, but I just couldn’t find out how to achieve this. Example (how it should be): Desired Result: I k…

Postgres on conflict do update on composite primary keys

I have a table where a user answers to a question. The rules are that the user can answer to many questions or many users can answer one question BUT a user can answer to a particular question only once. If the user answers to the question again, it should simply replace the old one. Generally the on conflict…

Combining 2 queries in 1 (select based on other select)

I have 2 queries: and second one base on first one They work nice, but I need them to work as a one combined query, result from access looks like this: But this gives me only empty table. Can you help me? Answer Your inner join depends on the right-hand-side table of the left join, this effectively converts t…