Home Forums SQL Server 2008 T-SQL (SS2K8) combining the results of multiple select statements in to a single row RE: combining the results of multiple select statements in to a single row

  • Use cross apply, like so

    select * from

    (select count (*) as Col1 from sys.columns where (column_id = 1)) x

    cross apply

    (Select Count (*) as Col2 from sys.columns where (column_id = 2)) y

    cross apply

    (Select Count (*) as Col3 from sys.columns where (column_id = 3)) z

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.