Home Forums SQL Server 2008 T-SQL (SS2K8) multiple columns to single column (normalization) RE: multiple columns to single column (normalization)

  • ah, solved it with lots of unions... sometimes it helps to write it in text...

    ill post the query in a sec, if someone else needs it.

    UPDATE: here's the query.

    SELECT id as carid, '1' as carparts FROM #cars WHERE part1=1

    UNION

    SELECT id as carid, '2' as carparts FROM #cars WHERE part2=1

    UNION

    SELECT id as carid, '3' as carparts FROM #cars WHERE part3=1