Skip to content

sum(datediff()) in oracle sql

so i need this to write in oracles sql using sysdate sum(datediff(day,Clan.Dat_od,(CASE when clan.dat_do is null then getdate() else clan.dat_do end ))) as brojdana

Referencing a column in an SQLite case statement

I have an SQLite table called table. It has 4 columns: col_1, col_2, col_3, col_4. If I was to use MySQL as a way of explaining what I want to do, it is something like this: SELECT CASE WHEN col_4 …

SQL case return more than 1 row write a string

I have a subquery in SELECT and sometimes it returns more than one row. I want to solve the problem like this: when more than 1 row write a string like ‘multi’ otherwise use the value description …