Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-180

select distinct gives OperationalError, select distinctrow is ok

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • None
    • N/A
    • DBAPI 2.0
    • None
    • Windows 10
    • 1.0.7

    Description

      Code

      nowym = datetime.now().strftime('%Y%m')

      sql = f"SELECT distinct clientID FROM zgx_forecasting WHERE date_format(STR_TO_DATE(concat(Jaar,'',Maand,'-01'),'%Y%m-%d'),'%Y%m')>='

      {nowym}' AND Productiviteitscode IN ('1','3','5','7','9') order by clientID"
      csr.execute(sql)

      returns mariadb.OperationalError: Unknown MySQL error

      Code
      sql = f"SELECT distinctrow clientID FROM zgx_forecasting WHERE date_format(STR_TO_DATE(concat(Jaar,'',Maand,'-01'),'%Y%m-%d'),'%Y%m')>='{nowym}

      ' AND Productiviteitscode IN ('1','3','5','7','9') order by clientID"
      csr.execute(sql)

      returns 388 rows

      Does python/connector support distinctrow only?

      Attachments

        Activity

          People

            georg Georg Richter
            vincent.lemoine@iwa-consult.nl V H Lemoine
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.