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

  • SEARCH
  • Home
  • 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 7861125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:34:22+00:00 2026-06-02T22:34:22+00:00

I have the following MySQL query that provides data to a Python web page.

  • 0

I have the following MySQL query that provides data to a Python web page. On the web page, I have a list of song titles, and I want it to be alphabetized ignoring punctuation and spaces. My MySQL database is UTF-8 encoded, and some of the punctuation that needs to be ignored is special characters such as curly apostrophes, etc.

SELECT * FROM Tracks\
JOIN Artists USING (ArtistID)\
JOIN Albums USING (AlbumID)\
JOIN Songs USING (SongID)\
ORDER BY UPPER(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(\
REPLACE(SoName, ' ', ''), /* space */\
                        ',', ''), /* comma */\
                        '.', ''), /* period */\
                        ':', ''), /* colon */\
                        ';', ''), /* semicolon */\
                        '!', ''), /* exclamation point */\
                        '?', ''), /* question mark */\
                   '\u201c', ''), /* left curly double quote */\
                   '\u201d', ''), /* right curly double quote */\
                   '\u2019', ''), /* right curly single quote (apostrophe) */\
                   '\u2013', ''), /* n-dash */\
                   '\u2014', ''), /* m-dash */\
                   '\u2026', '') /* ellipsis */), (SongID), UPPER(AlTitle)

The REPLACE in my query seems to work perfectly for the non-special characters, like the space, comma, period, etc., but it seems to skip over the special characters.

My guess is that the characters need to be written in a different format. I tried the following with no success:
REPLACE(SoName, '\u2026', '')
REPLACE(SoName, u'\2026', '')
REPLACE(SoName, 0xE280A6, '')…

  • 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-06-02T22:34:24+00:00Added an answer on June 2, 2026 at 10:34 pm

    MySQL string literals do not provide an escape sequence for multi-byte characters. This has been a feature request for over 7 years and is still awaiting triage: I wouldn’t hold my breath that it will be resolved any time soon.

    You must either put the actual character in your string literal, or else know its constituent bytes in your desired encoding (in which case you could then use something like CHAR()).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that executes the following MySQL query: SELECT 402 AS user_id,
I have following query and data saved in a MySQL database with a timestamp
I have the following MySQL query that I'm trying to translate into an equivalent
I have the following mysql query which I am running with php like so.
I have the following MySQL query statement: SELECT * FROM table1 INNER JOIN table2
I have the following mysql query: $manufacturers_query = select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from
I have the following MySQL query: SELECT value_1, ( SELECT value_4 FROM table_1 WHERE
I have the following sql query that fetches images from an establishment table. The
I have the following MySql query: select t1.* from Table1 t1 inner join Table2
I have the following MySQL query SELECT lp.profileTitle, lp.lessonLength AS length, la.validFrom, la.validTo, ow.firstname,

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.