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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:31:29+00:00 2026-05-20T06:31:29+00:00

I have a table like: ID word masterWord 1 test 1 1 test1 0

  • 0

I have a table like:

ID   word   masterWord
1    test   1
1    test1  0
1    test2  0
2    look   0
2    kiss   1
2    eye    0

Now I’d like to get from select statement 2 records with:

test      test1, test2
kiss      look, eye

First column is master word, second column in group_concat all the other words.

Master words are marked with true (1) in the table and the ID’s are declaration which words holds a group (of synonyms). Ok, I know I’ve made stupid words but I am making this for non English language that has one word has different endings depending on it’s count, gender etc…

Every ID MUST have one word selected as master word… if that helps query or not I don’t know 😉

  • 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-20T06:31:30+00:00Added an answer on May 20, 2026 at 6:31 am

    I think something like

    SELECT MAX(CASE WHEN masterWord = 1 THEN word END) AS masterWord ,
           GROUP_CONCAT(CASE WHEN masterWord = 0 THEN word END) AS OtherWords
    FROM YourTable       
    GROUP BY ID
    

    Should do it. Perhaps you might need to add a CAST to the GROUP_CONCAT input as well.

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

Sidebar

Related Questions

I have a sqlite3 query like: SELECT word FROM table WHERE word NOT LIKE
I have a table that looks something like this: word big expensive smart fast
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this
Not even how to word this question: I have a table that looks like
I have a mysql table that has 2796 entries. I'd like to select entries
In MySql, Let's say I have a table myTable ID word I would like
I have a table like as follows: SoftwareName Count Country Project 15 Canada Visio
I have a table like this: <table> <tfoot> <tr><td>footer</td></tr> </tfoot> <tbody> <tr><td>Body 1</td></tr> <tr><td>Body
I have a table like this (Oracle, 10) Account Bookdate Amount 1 20080101 100
I have a table like so <table> <tr id=trRow1 runat=server style=display: none> <td>First Name:</td>

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.