Sql query problem - TechRepublic
General discussion
June 10, 2002 at 03:42 PM
allooyaa

Sql query problem

by allooyaa . Updated 23 years, 11 months ago

This query is incorrect one :
SELECT DBNAME
FROM SYSIBM.SYSTABLEPART
WHERE DBNAME like
CASE DAYOFWEEK(CURRENT DATE)
WHEN 1 THEN ‘B11%’
ELSE ‘B12%’
END’
****it gives a msg:An incorrect value is used in a LIKE comparison (line 3, position 10). If i used the ‘=’ equal sign instead of like then it works ok.. This sql is run under DB2. I think that “like” does not work with CASE .

This discussion is locked

All Comments