1

my question may duplicated, I researched but I couldn't find out the answer I need.

My question is how can I re-formatting data from mysql select query.

comlum_01 is Char and data like 07/25/2013 or 7/25/2013.

I want to change query data to '20130725'.

Below is the sql sentence I want to make, change and put data in comlum new_comlum

Select A.comlum_01, reformat(A.comlum_01) as new_comlum from table_01 A; 

this one looks like similar but...

reformatting a date

Thank you very much for your help.

2

1 Answer 1

2
SELECT A.comlum_01, DATE_FORMAT(str_to_date(A.comlum_01, '%m/%d/%Y'), '%Y%m%d') AS New_comlum FROM table_01 A; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.