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://community.livejournal.com/sqlserver/36652.html

« First Time Poster || Using SQL Server to... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home