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 1074787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:10:56+00:00 2026-05-16T21:10:56+00:00

I have rows such as [ISSUE] This is a sample issue [WEBSITE] A bug

  • 0

I have rows such as

  • [ISSUE] This is a sample issue
  • [WEBSITE] A bug in the website
  • Note that this row doesn’t contain anything inside square brackets
  • [WEBSITE] Another bug in the website
  • [TRACKER] It is not live!
  • Some rows will have them in the [middle] but I don’t want them

etc..

Assume the field is called “Title” and the table is called “Issues”. All items in that column start with a string within square brackets. There is no definitive list of what words can come inside the square brackets. no restriction on the length also. I need not get it if the field doesn’t start with such a string.

I want to get the word inside the pair of square brackets and get a unique list of those words.

I want to select a distinct list of all the [XYZ]s. For example, in the list above, the query should return the following list of strings:

  • ISSUE
  • WEBSITE
  • TRACKER

It is a combination of substring logic, and distinct query. The logic might go like Find the index of the first [ and the first ] and get the string between that and from the list, make a unique list. I am finding it nearly impossible to write it in a single MySQL query. What is the query that will get that list?

  • 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-16T21:10:57+00:00Added an answer on May 16, 2026 at 9:10 pm

    In that case I would try:

    select distinct `Match` from (SELECT MID(Title,instr(Title,'[') + 1,instr(Title,']') - instr(Title,'[') -1) As 'New_Title'
    FROM Issues u Where instr(Title,'[') > 0 AND instr(Title,']') > instr((Title),'[')) tbl
    

    Sorry this took so long, I had to figure out how to return the string.

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

Sidebar

Related Questions

If I have a simple table where the data is such that the rows
I have rows like this... | NAME | RED | BLUE | GREEN |
I have a datagridview that may or may not have rows selected when the
I have a database in which there is a parent Account row that then
Sorry this is such a long question but it touches on a general issue
I have my UITableView data organized such that the sections of the table are
I have rows in a MySQL database, and each has a timestamp value. (ie
I quite often have rows of code like the following: UPDATE my_table SET name
What I am trying to do is have rows of images, 6 images in
Reproducible example below. I have a simulation loop, within which I occasionally have rows

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.