2017-08-16 153 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