2017-08-16 54 views
0

我有一个查询,其中有一个group_concat,但它返回一个错误,即group_concat不是内置函数。请帮我解决这个问题。我的查询是这样的:Group_concat不是内置函数 - HeidiSQL

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 

如何使用group_concat或者有没有其他解决方法?

+0

组concat不是ANSI sql函数..它存在于mySQL中但不确定它存在于任何其他数据库中。 – Steven

+1

试试这个 https://stackoverflow.com/questions/17591490/how-to-make-a-query-with-group-concat-in-sql-server – Harry

回答

0

字段的concat不应该是SQL查询的输出。这不是为了这个。使用接收数据的工具来执行此操作。

+0

什么样的工具? – bleykFaust

+0

你如何使用这些数据?在Excel中?报告工具?在网站与PHP?即时通讯谈论这个数据接收器接口。 – Steven

+0

我使用我网页上的数据并将其显示在桌面上 – bleykFaust