Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    11

    Unanswered: query assistance for SQL0104N

    This query is supposed to identify some duplicate rows and it probably works on oracle. Could someone please assist with turning this into db2 (9.7luw).

    SELECT DISTINCT BUSINESS_UNIT, PO_ID, EE_SEQ_NUM, COUNT(*) FROM PS_PO_LINE_DISTRIB HAVING COUNT (*) > 1 AND
    EE_SEQ_NUM > 0 GROUP BY BUSINESS_UNIT, PO_ID, EE_SEQ_NUM

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    What error message did you got?

    Please see error message text.
    It might include doubtfull token and some suggestions.

    Sequence of GROUP BY clause and HAVING clause are reversed.
    I doubt DISTINCT, because it is useless.

  3. #3
    Join Date
    Aug 2010
    Posts
    11
    SQL0104N An unexpected token "GROUP" was found following "1 AND EE_SEQ_NUM >0". Expected tokens may include: "ORDER". SQLSTATE=42601

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Sequence of GROUP BY clause and HAVING clause are reversed.
    The error message may suggest this case.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •