MySQL Forums
Forum List  »  Newbie

Re: Help using MySQL reformatting data
Posted by: Phillip Ward
Date: October 04, 2023 08:50AM

Quote

State - city - convinient store - chocolate_sku - strawberry_sku - cookiescream_sku

Something like this?

insert 
into table2 ( state, city, store, sku )
          select state, city, store, chocolate_sku as sku from table1
union all select state, city, store, strawberry_sku       from table1
union all select state, city, store, cookiescream_sku     from table1

Now, you only need a way to generate this statement but once you have that, you'll have you data properly stored.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: Help using MySQL reformatting data
October 04, 2023 08:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.