I'm a developer that uses Oracle database with .Net application. I successfully created a query to return some data that I want, and it returns something like this:
cod | charac1 | charac2 | items |
---|---|---|---|
I001 | blue | solid | X;1-3,5 |
I002 | red | liquid | Y;3-6,7,10 |
When I take this in, .Net is okay to handle the last column, I mean, it's easy to break it down like "X;1-3,5" to "X1,X2,X3,X5". However, my question is how can I do this by the query itself? That's is, how can I get the below table instead?
cod | charac1 | charac2 | items |
---|---|---|---|
I001 | blue | solid | X1 |
I001 | blue | solid | X2 |
I001 | blue | solid | X3 |
I001 | blue | solid | X5 |
I002 | red | liquid | Y3 |
I002 | red | liquid | Y4 |
I002 | red | liquid | Y5 |
I002 | red | liquid | Y6 |
I002 | red | liquid | Y7 |
I002 | red | liquid | Y10 |
I need this because the above result has hundreds of thousands and it may take some time to process it in client application.
Also, I did some search and I found a very good post Converting intervals of values into an IN-list for query filters that explains pretty much like I would like to have, but "only for one row". I don't know how I can apply it to my case. Do you have any directions to help me?
Note: the "items" column has always a letter and ";".
Edit1: the integers runs over 1-9999 interval. This can simplify the use of the tips given by 1.
Thank you all!