sql help

Giacomo Vernoni giacomo at way-out.it
Wed May 12 09:12:39 CDT 2010


Hi list,
not Valentina related, but Valentina developed :-)

I'll explain my request with an example.

Look at table1:

| name   | surname | town     | color  |
| John   | Smith   | New York | Blue   |
| John   | Smith   | New York | Red    |
| Steve  | Jobs    | Rome     | Blue   |
| Steve  | Jobs    | Rome     | Green  |
| Carl   | Mirren  | London   | Yellow |

I created table2 and I want to populate this new table with data from  
table1, but in this way:

| name   | surname | town     | red | green | blue | yellow | white |  
black |
| John   | Smith   | New York | 1   |       | 1    |        |        
|       |
| Steve  | Jobs    | Rome     |     | 1     | 1    |        |        
|       |
| Carl   | Mirren  | London   |     |       |      | 1      |        
|       |

Does anybody know how to do this in SQL?

A huge thank to the person who can solve my problem!

Giacomo


More information about the Valentina mailing list