Joseph Yeagle Joseph Yeagle - 1 year ago 84
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)?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download