Creating a new table from 2 columns
Date: 10/28/05
(SQL Server) Keywords: no keywords
Hey guys, hopefully quick question:
I have a table with 2 columns that looks like this called OldList:
User Fruit
-------------------------------
Chris Apples
Chris Grapes
Chris Oranges
Adam Apples
Jordan Apples
Jordan Oranges
Mike Grapes
Mike Oranges
And I need to write a query to populate a new table (NewList), and the results should look like this:
User Apples Grapes Oranges
----------------------------------
Chris Yes Yes Yes
Adam Yes
Jordan Yes Yes
Mike Yes Yes
Any ideas?
Thanks in advance!
Source: http://www.livejournal.com/community/sqlserver/36652.html