MySQL Tricks

Home / Coding Tricks / MySQL Tricks

Date Formatting

DATE_FORMAT('2016-12-05', '%M %e, %Y')

Output: December 5, 2016

Get a list of all Columns in a Table

SELECT
  COLUMN_NAME
FROM
  information_schema.columns 
WHERE
  table_schema = 'DATABASE_NAME' and table_name = 'TABLE_NAME';

Leave a Reply

Your email address will not be published. Required fields are marked *