Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5195

Osisoft translator - applying LIMIT on a UNION query causes syntax error

    Details

      Description

      Query such as

      SELECT g_0.intkey FROM bqt1.smalla g_0 UNION SELECT g_1.intkey FROM bqt1.smallb g_1 LIMIT 100
      

      fails with

      [PIOLEDBENT] [SQL Parser] [Line 1:106] Syntax error at 'TOP'
      

      because it is translated as

      SELECT g_1.IntKey AS c_0 FROM dvqe..SmallA AS g_1 UNION SELECT g_0.IntKey AS c_0 FROM dvqe..SmallB AS g_0 TOP 100
      

      notice the TOP 100 at the end, instead of right after the SELECT.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rareddy Ramesh Reddy
                Reporter:
                asmigala Andrej Smigala
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: