MySQL Forums
Forum List  »  Newbie

Re: select statement as per the column content
Posted by: Phillip Ward
Date: September 02, 2016 05:45AM

Quote

Its not about storing more than 1 value in a single column.

I disagree. That's exactly what this is about and exactly what you should not do when designing a database. Read up on "Normalisation".

Your spreadsheet contains
"123"   "abc*cvbsmdm*cbdjdk(9)*asdre-01"

and you want to retrieve this as
+-------------+-----------+ 
| part_number | filename  | 
+-------------+-----------+ 
|         123 | abc       | 
|         123 | cvbsmdm   | 
|         123 | cbdjdk(9) | 
|         123 | asdre-01  | 
|         124 | qwe       | 
+-------------+-----------+
The most sensible way to achieve this is to break up that delimited string and actually store it in the way you want to retrieve it. If you're just going to try and force your database to be a spreadsheet, then you might as well leave the data in the spreadsheet and use some ODBC tools to query it directly!

You have a spreadsheet containing this delimited data that, in database terms, represents multiple rows. You need to transform that data into something more suitable for your database to work with and then import the result of that transformation.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: select statement as per the column content
September 02, 2016 05:45AM


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.