Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-280

Wrong result from select when aliasing to same name as used in group by

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Incomplete
    • None
    • None
    • SQL
    • None

    Description

      Wrong result from select when aliasing to same name as used in group by. Example:

      If we have the following table:

      ij> select * from tt;
      I |J
      -----------------------
      1 |2
      2 |3
      1 |2
      2 |3
      2 |3

      5 rows selected

      The following select is ok:

      ij> select i, count as cnt from tt group by i;
      I |CNT
      -----------------------
      1 |2
      2 |3

      2 rows selected

      But this one returns wrong result in the aliased column:

      ij> select i, count as i from tt group by i;
      I |I
      -----------------------
      1 |1
      2 |2

      2 rows selected

      Attachments

        1. bug280.diff
          10 kB
          Richard N. Hillegas

        Issue Links

          Activity

            People

              rhillegas Richard N. Hillegas
              bernt Bernt Johnsen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: