notifications - How can I use MySQL alias in Where condition -


i have column date of months in table,
table_date
17
13
12
04
check these date lesser current date
trying, or there other better way.

select concat(date_format(now(),'%y-%m'),'-',table_date) duedate dhr due date < curdate()
have error as
unknown column 'duedate' in 'where clause'

i found concatenating must done in condition

select table_date table_name concat(date_format(now(),'%y-%m'),'-',table_date) < curdate()


Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

c++ - Checking for a nested, templated class -

php - facebook and github login HWIOAuthBundle and FOSUserBundle in Symfony2.1 -