SQL Query Help

  • Can anyone help me build a sql for teh below scenario

    id score

    1 100

    2 200

    3 300

    4 500

    I need a output as Total scrore scoremorethan200

    1100 800

    the above being 2 columns as output one with total score and another having total count of score >200 any help on this will be greatly appreciated. TIA

  • select sum(score) as TotalScore

    , sum( case when score > 200 then score else null end )

    as GT200TotalScore

    from ....

    SQL = Scarcely Qualifies as a Language

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply