MySQL Forums
Forum List  »  Newbie

select statement as per the column content
Posted by: chinmay panda
Date: July 14, 2016 11:51AM

DB INPUT >> DB OUTPUT

DB INPUT

CODE
abc-1
,abd-1
abe-1
,xyz-1
,sef-1
,abw-1
qwe-1
,xsw-1
,ret-1

DB OUTPUT

CODE-A CODE-B
abc-1 abd-1
abe-1 xyz-1
abe-1 sef-1
abe-1 abw-1
qwe-1 xsw-1
qwe-1 ret-1

Here it checks for the string content with comma (,) and from single column in the input file append it to two columns in the output file.
the one which contains comma are appended in the second column, and the one without the output are appended in the first and act as the parent (as they are appended multiple times based on the comma.


Hope this is clear enough

Options: ReplyQuote


Subject
Written By
Posted
select statement as per the column content
July 14, 2016 11:51AM


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.