我有這個MySQL查詢,它工作得很好,我只需要爲properties.advantages.
中的每個id抓取advantages.value
正如您在圖像中看到的那樣,列Advantages設置得很好(至少對於我,我沒有創建這個),ID由-
分隔。我怎樣才能獲得這些價值?從表中選擇值,ID在一列
SELECT
properties.id,
(SELECT types.value FROM types WHERE types.id = properties.type_id) as types,
properties.price,
properties.town_id,
**(SELECT advantages......),**
towns.id,
towns.value
FROM properties
LEFT JOIN towns
ON properties.town_id=towns.id
WHERE properties.published='1'
有什麼問題嗎? – sagi
嗯,對不起,我需要獲得這些值,對於列 –