0

I have a query with a group_concat in it but it returns an error that the group_concat is not a built in function. Please help me to resolve this. My query is like this:

 SELECT cast(user_id as varchar(255)) AS member_id,skincareproductbarcode.barcode, skincareproduct.SCP_id, skincabinet.beautybox_id,  
        skincabinet.skpid, skincareproduct.photos, skincabinet.create_date, GROUP_CONCAT(MirrorProfile.serial_number, '') As Serial_Number
         from skincabinet join skincareproduct on skincareproduct.scp_id = skincabinet.skpid 
         full join skincareproductbarcode on skincabinet.skpid = skincareproductbarcode.scp_id
          full join membermirrorprofile on skincabinet.user_id = membermirrorprofile.member_id
           full join mirrorprofile on MemberMirrorProfile.mirror_id = mirrorProfile.mirror_id 
             where skincareproduct.approval_flag = 'N' and skincareproduct.photos != '' 
             and substring(photos,52,3) = 'scp' order by skincareproduct.SCP_id  group by skincareproduct.scp_id desc

How can I use group_concat or is there any other way around?

2
  • group concat is not a ANSI sql function.. it exists in mySQL but not sure it exists in any other db. Commented Aug 16, 2017 at 4:02
  • 1
    try this stackoverflow.com/questions/17591490/… Commented Aug 16, 2017 at 4:22

1 Answer 1

0

the concat of fields should not be the output of the SQL query. It is not made for that. Use the tool which receive the data to make this action.

Sign up to request clarification or add additional context in comments.

5 Comments

what kind of tool?
how do you use the data ? in excel? in reporting tool? in website with php? im talking about this data receiver interface.
I using the data on my webpage and display it on a table
then you should think how to perform that with your webpage code. That is the best practice way to do it. But if really you want SQL, there are some ways ... which may result to performance issues most of the time.
I don't know how can I perform that with my webpage code can you give me an idea?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.