I have problem mixing pattern match and curdate() function. Below is the table structure, where some of the fields current date is updated everyday. I am not sure whether they can be mixed.Please help me sort this out. Thanks.
ta1 ta2 ta3 ta4
a20120204 20120204 20120204 20120203
a20120204123 20120204 20120203 20120203
I want my like pattern to be 'a20120204', which is current date prefixed by character 'a'.
My non-working intuitive query:
SELECT * FROM [table] WHERE ta1 LIKE 'a'+(CURDATE( ) +0)%
- (CURDATE()+0) returns current date as YYYYMMDD