Are you quite sure there can never be more than 16 orders per ID ?
The form your table is in now is actually the preferred form. It's called an
associative table, and logic suggests that it sits between a table that
holds more info on the IDs, and a table that holds more info on the orders.
On Mon, Apr 12, 2010 at 5:11 PM, Mitchell Maltenfort <mmalten@stripped>wrote:
> I have a table with two columns, ID and order. Each ID can be
> repeated up to 16 timers.
>
> I need to reshape it so that I have one row per ID, and columns
> order1, order 2,...order 16, and one number that lists how many orders
> there actually were.
>
> No this is not a homework assignment. I'm trying to make sense out of
> a legacy project.
>
> Can someone help me out?
>
> Thanks!
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1
>
>
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
| Thread |
|---|
| • reshaping challenge | Mitchell Maltenfort | 12 Apr |
| • Re: reshaping challenge | Johan De Meersman | 13 Apr |