Home Forums SQL Server 2008 T-SQL (SS2K8) use column in Group By, but Hide column from the results set RE: use column in Group By, but Hide column from the results set

  • Phil Parkin (9/19/2012)


    Eugene Elutin (9/19/2012)


    Yes it is possible, but what it will give you?

    SELECT Col1, Count_Rec

    FROM (SELECT Col1, Col2, Count(*) AS Count_Rec

    FROM MyTable

    GROUP BY Col1, Col2) aq

    Haha, what a fantastically useful query this would be 😀

    Who knows, who knows... :hehe:

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]