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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:44:25+00:00 2026-05-29T21:44:25+00:00

hi guys is it posible to use GROUP_CONCAT and CONCAT function in same query

  • 0

hi guys is it posible to use GROUP_CONCAT and CONCAT function in same query i am trying to use

SELECT GROUP_CONCAT(CONCAT(idmaterial,percent)) as 'material' FROM a_m where idarticle=1

to get result like this in one row one column

material
----------
1 5%10 6%80 1%10

please help me with your ideas thanks a lot here is my table thanks a lot for your helps

    idarticle |idmaterial| percent
    ---------- ---------- ----------
    1              5        10
    ---------- ---------- ----------
    1              6        80    
    ---------- ---------- ----------
    1              1        10
    ---------- ---------- ----------
    2              1        90
    ---------- ---------- ----------
    2              2        10
    ---------- ---------- ----------
  • 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-29T21:44:29+00:00Added an answer on May 29, 2026 at 9:44 pm

    GROUP_CONCAT goes with GROUP BY:

    SELECT idarticle, 
      GROUP_CONCAT( CONCAT( idmaterial, '%', percent ) SEPARATOR ' ' ) as materials
    FROM a_m
    GROUP BY idarticle
    

    And to put in one column you can use:

    SELECT CAST(CONCAT( idarticle, ' ', 
      GROUP_CONCAT( CONCAT( idmaterial, '%', percent ) SEPARATOR ' ' ) ) AS CHAR) as material
    FROM a_m
    GROUP BY idarticle
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I created a list for fixtures. $result = mysql_query(SELECT date FROM .TBL_FIXTURES.
Hey guys, i'm trying to use the following drawing logic: Class Game { Character
Hi guys i am trying to use a custom sqlite queries in android. i
Guys, what is function called after my class loaded, where i can call self
Hey guys, I have some code that I found that I would rather use
I use: window.print(); to print documents. Problem: As you guys know that browsers automatically
Hey guys, Is it possible to use another name for the page that is
I have this, as part of a bigger query: CAST( GROUP_CONCAT( c.fname) AS char
please guys, before I download eclipse, is it possible to use it to compile
Hey guys, is it possible to catch and ignore a JError::raiseError? I use JDatabase

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.