Is COUNT a valid expression in SQL DB2 in iSeries?

56,495 pts.
Tags:
COUNT
SQL DB2 iSeries
Can I use COUNT in SQL DB2 in iSeries for row partitions? I've tried to run the following query:
select COUNT(1) over (partition by COL1, COL2) from MyTable
and received the following error message:
[Message SQL0401] Token ( is not a valid token. A partial list of valid tokens is , FROM INTO.
How can I solve this?
ASKED: December 20, 2013  7:23 PM
UPDATED: December 24, 2013  7:01 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Add your answer…

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb

    You might want to look at this: http://forums.iprodeveloper.com/forums/aft/148438

    Count yes, over (partition no.

    48,575 pointsBadges:
    report
  • TomLiotta

    What is the intended result? Would this give a similar result?

    select COUNT(*) from MyTable group by COL1, COL2

    If not, how should the result differ?

    Tom

    125,585 pointsBadges:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following