INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Query - Comma list to rows

Query - Comma list to rows

(OP)
I cannot seem to find the solution to this, your help would be veru much appriciated.

I need to create a query that takes a column containg a comma delimited list and produces rows for each value...

For example.

Table A

Item_Name    Item_Number    Item_List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Item1        1000        "W,X,Y,Z"
Item2        2000        "W,X,Y,Z"
Item3        3000        "W,X,Y,Z"




Here is what I would like for results:

Item_Name    Item_Number    Item_List    Item_Value
Item1        1000        "W,X,Y,Z"    W
Item1        1000        "W,X,Y,Z"    X
Item1        1000        "W,X,Y,Z"    Y
Item1        1000        "W,X,Y,Z"    Z
Item2        2000        "W,X,Y,Z"    W
Item2        2000        "W,X,Y,Z"    X
Item2        2000        "W,X,Y,Z"    Y
Item2        2000        "W,X,Y,Z"    Z
Item3        3000        "W,X,Y,Z"    W
Item3        3000        "W,X,Y,Z"    X
Item3        3000        "W,X,Y,Z"    Y
Item3        3000        "W,X,Y,Z"    Z

How can I accomplish this ?

Thanx again !
 

RE: Query - Comma list to rows

MDiaz,

Are there a fixed number of items in your ITEM_LIST, or is the number variable?

santaMufasa
(aka Dave of Sandy, Utah, USA)
"People may forget what you say, but they will never forget how you made them feel."

RE: Query - Comma list to rows

(OP)
Sorry, I probably should have mentioned that. The length (number of values) of the list is NOT fixed.

-Mario-

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close