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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:42:06+00:00 2026-05-24T10:42:06+00:00

I have a table with the following columns: boxid – nouns – username 1

  • 0

I have a table with the following columns:

boxid - nouns - username

1 - w1,w2,w3 - user1
1 - w3,w2,w4 - user2
1 - w1,w8,w5 - user1
2 - w7,w2,w5 - user2

and at the present I have a query that allows me to extract the following:

SELECT boxid, group_concat(concat(username,":",nouns) SEPARATOR "|") as listn  
FROM table group by boxid;

that query gives me back the following:

box1 - user1:w1,w2,w3|user2:w3,w2,w4|user1:w1,w8,w5

However, I would like to get all nouns of the same user without repeating users (but repeating words of every user), something like the following result:

box1 - user1:w1,w2,w3,w1,w8,w5|user2:w3,w2,w4

Can someone show me if this can be done with mysql and how? I have no idea of this…

(I can do this with php, but I think getting the direct result in sql would be faster…)

Thanks in advance…

  • 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-24T10:42:07+00:00Added an answer on May 24, 2026 at 10:42 am

    Try this:

    SELECT boxid, group_concat(concat(username,":",nouns_list) SEPARATOR "|") as listn  
      FROM 
        (
        SELECT boxid, username, group_concat(nouns)  as nouns_list
            FROM table 
        GROUP BY boxid, username
    ) a
    GROUP BY boxid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that contains the following columns: ID int, DISTANCE float, EVENT
I have a table that has following columns id store_id store_name id and store_id
Say I have a table that has the following columns: AutoID (PK, int not
I have a table that has the following columns table: route columns: id, location,
I have a table that contains the following columns: @Column(name=CTDESTATUS) private String status; @Column
Lets say I have table with following columns 1. Client - string. 2. Profit
I have a table with following columns: ContractorId ......... INT ............. IDENTITY ContractorName ........
I have a table with the following columns in SQL Server: MEMBERID, MEMBEREMAIL, FATHEREMAIL,
I have a table with the following columns: ref_year, ref_no, inv_id, start_date, end_date The
I have a table with the following columns (I simplified it a little): PRODUCT_name

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.