• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

SQL missing sum/group by functionality

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL missing sum/group by functionality

    I have a data source that works fine, but as soon as I add either a sum column or a group by statement, or both, I get SQL error SQL0122. Are these not supported?

  • #2
    What is the SQL of the data source?

    Comment


    • #3
      SELECT
      mprod,
      mqiss,
      mqreq,
      mopno,
      pqord - pqrec AS qoord,
      rrn(FMAL01) AS rrn1,
      rrn(HPOL23) AS rrn2
      FROM
      fmal01
      LEFT OUTER JOIN hpol23 ON mprod = pprod
      WHERE
      (
      mord = vvin_virtual('shopOrder', '99999999', 'num', 8, 0)
      )


      I've been replacing the vvin_virtual with the value 134888 for testing

      Comment


      • #4
        Which column are you trying to summarize or group by in the grid?

        Comment


        • #5
          Ideally I would summarize qoord and group by mprod

          Comment


          • #6
            Can you provide the statement you're trying to execute when you receive the SQL error?

            Thanks

            Comment


            • #7
              SELECT
              mprod,
              mqiss,
              mqreq,
              mopno,
              SUM(pqord - pqrec) AS qoord,
              rrn(FMAL01) AS rrn1,
              rrn(HPOL23) AS rrn2
              FROM
              fmal01
              LEFT OUTER JOIN hpol23 ON mprod = pprod
              WHERE
              (
              mord = vvin_virtual('shopOrder', '99999999', 'num', 8, 0)
              )
              GROUP BY mprod

              Comment


              • #8
                It's showing you that error because the SQL statement is invalid. To resolve it, you'll need to include additional columns in the 'group by' clause.

                Comment

                Working...
                X