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

SQL query range on a string field

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • None
    • N/A
    • Optimizer, Server
    • None
    • MariaDB 10.5.4 on Linux using MySQL Workbench

    Description

      Hi,

      If i run this query it only gives me the Cities that begin with the letter 'A'
      SELECT * FROM vagtc_db.CitySrch WHERE City >= "0%" AND City <= "B%" ORDER BY City ASC ;

      I would expect it to return all cities that start with 'A and 'B'. It seems to stop at the '<' and not include the '=' with it.

      If i run this then i receive everything. But i had to specify the last city in the 'B' range. Or if I use 'C%' then I receive all cities that begin with 'A' and 'B'.
      SELECT * FROM vagtc_db.CitySrch WHERE City >= "0%" AND City <= "Bucksport" ORDER BY City ASC ;

      Best regards,
      Chris

      Attachments

        1. CitySrch.sql
          0.1 kB
        2. Maine.csv
          3 kB

        Activity

          People

            Unassigned Unassigned
            gillesch Christopher Gillespie
            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.