Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5464

sql shows the wrong values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.34
    • None
    • None
    • None
    • windows server Glassfish 4.0 eclipse primefaces

    Description

      this sql shows the wrong values. The order by in the left join shows the oldest values and not the values which are stored after t2.giltab <= '2013-12-22' . In the table are values with different validity date and i want to show only the last one and not the history. In Mysql it works. But we want to use mariadb in our opensource erp-application http://osretail.de/osRetail/

      SELECT t2.mwstimhundert,t2.satz, t2.land, t2.code, t2.giltab
      FROM mwst m
      LEFT JOIN (SELECT * FROM mwst m1 ORDER BY m1.giltab DESC) AS t2 ON m.mandant = t2.mandant AND m.land = t2.land AND m.code = t2.code
      WHERE m.mandant = 999 AND t2.giltab <= '2013-12-22'
      GROUP BY t2.land, t2.code
      ORDER BY t2.land DESC, t2.giltab DESC, t2.code DESC 

      Attachments

        1. datatable.JPG
          52 kB
          Peter Magsam
        2. mariaDB_wrong.JPG
          46 kB
          Peter Magsam
        3. mysql_correct.JPG
          28 kB
          Peter Magsam

        Activity

          People

            elenst Elena Stepanova
            magsam Peter Magsam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.