Date formatting with LOAD DATA INFILE


/ Published in: MySQL
Save to your folder(s)

Came across this nice snippet @ mysql.com


Copy this code and paste it in your HTML
  1. LOAD DATA INFILE '/tmp/foo.dat'
  2. FIELDS TEMINATED BY '|'
  3. LINE TERMINATED BY '\n'
  4. (col1, col2, @col3, @col4, col5)
  5. col3 = DATE_FORMAT(@col3, '%m/%d/%Y'),
  6. col4 = DATE_FORMAT(@col4, '%Y-%m-%d')

URL: http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.