我有一個查詢,其中有一個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或者有沒有其他解決方法?
組concat不是ANSI sql函數..它存在於mySQL中但不確定它存在於任何其他數據庫中。 – Steven
試試這個 https://stackoverflow.com/questions/17591490/how-to-make-a-query-with-group-concat-in-sql-server – Harry