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

  • dwain.c (11/19/2012)


    Eugene Elutin (11/19/2012)


    Michael Valentine Jones (11/19/2012)


    This should work also:

    select

    ...

    union select 7,19,15,12,-13

    union select 7,19,15,12,-13

    It's not so simple as appears at first glance, so check my version...;-)

    I think you meant to use "union all select" so that the last entry (a duplicate) is retained.

    Your next solution gets a +1!

    No, I really didn't, it was just cut-&-paste, the data variation above is enough for testing functionality of the query...

    Thanks for "+1", I like it too 🙂

    _____________________________________________
    "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]