• Separate SUM results on a single line

    Can DB2 return separate SUMfunction within one statement. If I have : SELECT BRANCH,SUM(AMOUNT) ,COUNT(*) FROM TableA WHERE BRANCH IN (180002,180092) gives Branch,Amount,Count 180002,+100,3 can I return two SUMs - one for positive values of amount and one for negative amounts so will get :...

    PeterWarren15 pointsBadges:
  • Finding nth most recent action with SQL

    I am trying to determine the date on which a certain number of things have happened cumulatively, eg I have a varying number of buyers each month. I want to find out on what date of that month, those buyers make their 3rd purchase. My SQL doesn't seem to support TOP or ROWCOUNT so I would...

    Munona995 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.