【问题标题】:Group_concat is not a built in function - HeidiSQLGroup_concat 不是内置函数 - HeidiSQL
【发布时间】:2018-01-24 01:55:13
【问题描述】:

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

 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 或者有其他方法吗?

【问题讨论】:

标签: sql sql-server group-concat sql-server-group-concat


【解决方案1】:

字段的连接不应该是 SQL 查询的输出。它不是为此而设计的。使用接收数据的工具来执行此操作。

【讨论】:

  • 什么样的工具?
  • 您如何使用数据?在excel中?在报告工具中?在用php的网站?我正在谈论这个数据接收器接口。
  • 我使用网页上的数据并将其显示在表格上
  • 那么您应该考虑如何使用您的网页代码执行该操作。这是做到这一点的最佳实践方式。但如果你真的想要 SQL,有一些方法......大多数时候可能会导致性能问题。
  • 我不知道如何使用我的网页代码执行此操作,您能给我一个想法吗?
猜你喜欢
  • 2016-12-01
  • 2012-08-15
  • 1970-01-01
  • 2019-06-14
  • 2017-05-08
  • 2012-05-27
  • 2016-03-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多