Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3633390
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:38:49+00:00 2026-05-19T00:38:49+00:00

We have a standard MySQL 5.1 database with a table named places. We have

  • 0

We have a standard MySQL 5.1 database with a table named places. We have two columns, name and name_bg, where name is the english name of the place and name_bg is the bulgarian name of the place.

We have two places that starts with “РИМ”. “Рим” and “Римини”.

+--------+--------+--------------+
| id     | name   | name_bg      |
+--------+--------+--------------+
| 221543 | Rimini | Римини       |
|  34514 | Rome   | Рим          |
+--------+--------+--------------+

When searching like this:

select id, name from places where name like 'рим%';

Or like this:

select id, name from places where name_bg like 'рим%';

Everything looks fine.

The weird stuff is when searching like this (the GROUP BY clause):

SELECT places.name, places.name_bg, places.country_id, countries.continent_id WHERE places.name LIKE 'рим%' OR places.name_bg LIKE 'рим%' ORDER ("CHAR_LENGTH(places.name), CHAR_LENGTH(places.name_bg), countries.continent_id, places.popular DESC") GROUP BY country_id LIMIT 10

The query returns Римини first instead of Рим.

We have tryed order and group on the query but nothing helped.

Even switched the IDs of the places but the same result occured.

We want to have the shortes result first.

Any help is appriciated.

Best,
Yavor

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:38:50+00:00Added an answer on May 19, 2026 at 12:38 am

    It’s not clear to me why you expect that it should. Does the length function do what you need?

    SELECT id,
           name
    FROM   places
    WHERE  name_bg LIKE 'рим%'
            OR name LIKE 'рим%'
    ORDER  BY Length(name)  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a custom software project that's database driven (MySQL) and is built with
I am writing an email application that interfaces with a MySQL database. I have
I have a standard Rails app that uses a database, sqlite3 and the webrick
Many languages have standard repositories where people donate useful libraries that they want others
I have a standard windows server that inherits from the ServiceBase class. On the
I have a bunch of ASP.NET web pages (that have a standard layout) that
I have a dataset that points to a View in my SQL database, and
I have a pretty standard table set-up in a current application using the .NET
I have a PHP MySQL database which I will be storing all my information
I have a script that appends some rows to a table. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.