MySQL Forums
Forum List  »  Microsoft Access

sort-of-dynamic query
Posted by: Adam Miller
Date: March 04, 2010 03:28PM

I have a question about a query. I am not sure if it is possible to do what I will suggest, but that's why i am here!

I have a table arranged as follows, with ID + Data making up the primary key.
ID Data
1 7
1 12
1 14
2 3
2 9
3 17
3 23
3 42
3 43

I would like to create a query that will somehow "know" how many columns to create, and end up with a table as follow:

ID Data1 Data2 Data3 Data4
1 7 12 14
2 3 9
3 17 23 42 3

Is this possible? I know I can do this with code, but I was trying to keep it nice and tidy.

Thanks in advanced.

Options: ReplyQuote


Subject
Views
Written By
Posted
sort-of-dynamic query
3352
March 04, 2010 03:28PM


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.