i have problem using LIKE structure in DB2:
for example:
select * from TEST where TIME LIKE '2012-03-04-%'
FYI. – TIME is TIMESTAMP data type.
why using LIKE with TIMESTAMPS do not work?
Additional info: i want to extract data from one single day provided by user in select statement.
Just expanding on @mortb’s answer, I’d either use
BETWEENorThe advantage of using
BETWEENor a comparison that usingcastsandLIKEwill mean that if there is an index ontimeit wouldn’t be able to be used due to the casting.