Helpful Information
Home
Categories
Contact us
Category: MySQL
selecting fields with the same month
how can i select all the fields in a table with say the month june?
i have a column that is datetime
use could use substring (though there may be a better way) - you just need to know what the date fornat is... i.e. with a TIMESTAMP(14)
SELECT * FROM $table WHERE SUBSTRING(fieldname,5,2)='06'
you can easily find the desird month:
SELECT * FROM $table WHERE date_filed LIKE '%-06-%'
privacy (GDPR)