view raw
Joseph Yeagle Joseph Yeagle - 5 months ago 48
SQL Question

Mysql date year and month information

SELECT user_guid, test_name, subcategory_name
FROM complete_tests
WHERE YEAR(created_at) ='2014' AND MONTH (created_at) = '10' LIMIT 100;

When coding with mySQL and using WHERE for the date info, is the "created_at" specific to the tables i am working with or will i always use (created_at)?


In this query the created_at field is relative to the table complete_tests. It will work only if created_at is a DATE or DATETIME type field.