From: Peter Brawley Date: August 17 2005 4:22am Subject: Re: how to arrange my table in another direction List-Archive: http://lists.mysql.com/mysql/187940 Message-Id: <4302BB74.4090806@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-4302BB767367=======" --=======AVGMAIL-4302BB767367======= Content-Type: multipart/alternative; boundary=------------070803050607090004040302 --------------070803050607090004040302 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit />My table is: >type price >car 1000 >bike 100 >I want the result: >car bike >1000 100/ You seem to want to turn rows into columns. That's often called a "pivot table". There's a step-by-step for pivot tables at http://www.artfulsoftware.com/queries.php#24. There're other pivot table examples on the same page. PB --------------070803050607090004040302 Content-Type: text/html; charset=GB2312 Content-Transfer-Encoding: 7bit
>My table is: