List:General Discussion« Previous MessageNext Message »
From:Mark Dale Date:July 26 2006 1:49am
Subject:Returning results as a field name
View as plain text  
Hello MySQL List

I have a simple table that outputs results like so:

select name, question_id, answer from table;
      +-------+--------------+---------+
      |NAME   |QUESTION_ID   |ANSWER   |

      +-------+--------------+---------+
      |Mark	  |100	     |Yes	   |	
      |Mark	  |101	     |No	   |
      |Leigh  |100	     |Yes      |	
      |Leigh  |101	     |No	   |
      +-------+--------------+---------+	

 Is there a way to query things so the result looks like this:
      	
      select ???
      +--------+-----------+-----------+
      |NAME    |100        |101        |
      +--------+-----------+-----------+
      |Mark	   |Yes	   |No         |
      |Leigh   |No	   |Yes	   |	
      +--------+-----------+-----------+

cheers

Mark Dale

mark.dale@stripped
Thread
Returning results as a field nameMark Dale26 Jul
  • Re: Returning results as a field nameChris26 Jul
RE: Returning results as a field nameMark Dale26 Jul
  • Re: Returning results as a field namePeter Brawley26 Jul
    • Re: Returning results as a field namePeter Brawley26 Jul
      • RE: Returning results as a field nameMark Dale27 Jul