I want to get records of a month , like 8th month i.e august so how can i compare 8 with timestamp field
SELECT * FROM `reserve_Product` WHERE MONTH(`date`) = 8
I want to get records of a month , like 8th month i.e august so how can i compare 8 with timestamp field
SELECT * FROM `reserve_Product` WHERE MONTH(`date`) = 8
You have to use DATE_FORMAT
SELECT * FROM reserve_Product WHERE DATE_FORMAT(`date`, '%m') = 8
Try this fiddle : http://sqlfiddle.com/#!9/ef36c/3