From: Johan De Meersman Date: April 13 2010 9:51am Subject: Re: reshaping challenge List-Archive: http://lists.mysql.com/mysql/221216 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=00504502984359df5504841b33e9 --00504502984359df5504841b33e9 Content-Type: text/plain; charset=ISO-8859-1 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 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=vegivamp@stripped > > -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel --00504502984359df5504841b33e9--