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

select distinct gives OperationalError, select distinctrow is ok

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: N/A
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Environment:
      Windows 10
    • Python Version:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            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.