How to convert a string to date in MySQL?

As was told at MySQL Using a string column with date text as a date field, you can do You can also handle these date strings in WHERE clauses. For example You can handle all kinds of date/time layouts this way. Please refer to the format specifiers for the DATE_FORMAT() function to see what you … Read more

MySQL AS keyword

I’m not professional in query writing, but wrote many from the time I began MySQL. Recently I noticed there is no need to type AS keyword in name aliasing. equals to However I know that this ability is out from years ago. I’ve 2 questions around this subject: Is AS keyword redundant? Sometimes ago when … Read more

LAST_INSERT_ID() MySQL

You could store the last insert id in a variable : Or get the max id from table1 (EDIT: Warning. See note in comments from Rob Starling about possible errors from race conditions when using the max id) (Warning: as Rob Starling points out in the