[MonetDB-users] Is there IF(), IFNULL() in SELECT?

30 Aug
2012
30 Aug
'12
11:02 p.m.
Sorry if it was asked before, I can't find a comprehensive list of functions available. Is it possible to somehow implement something like this: SELECT IF(col1>0,'Negative','Positive') as Sign, IFNULL(col2,'Empty',col2) as col2 FROM table; // it's just an example, not the exact query :) Thanx!

31 Aug
31 Aug
9:50 a.m.
On 30-08-2012 17:02:15 -0400, Dmitry Insta wrote:
SELECT CASE WHEN col1 > 0 THEN 'Negative' ELSE 'POSITIVE' END AS "Sign", CASE WHEN col2 IS NULL THEN 'Empty' ELSE col2 END AS col2 FROM table; You may need explicit casts to make the strings from the WHEN and ELSE clauses fit/be compatible.
4767
Age (days ago)
4768
Last active (days ago)
1 comments
2 participants
participants (2)
-
Dmitry Insta
-
Fabian Groffen