Home Forums SQL Server 2008 T-SQL (SS2K8) Need help with a script to identify count of negative and positive numbers in a record RE: Need help with a script to identify count of negative and positive numbers in a record

  • This should work also:

    select

    abs(sign(col1)+sign(col2)+sign(col3)+

    sign(col4)+sign(col5)) as NegativeCount

    sign(col1)+sign(col2)+sign(col3)+

    sign(col4)+sign(col5)+5 as PositiveCount

    from

    MyTable