1
我有兩個表:過濾條件
表Filters
id INT(11) PRIMARY KEY
text VARCHAR(50)
表items
id INT(11) PRIMARY KEY
title VARCHAR(255)
我想dipslay所有過濾條件與計數一起FO他們之間的標題發生
我curre ntly使用這種說法,但我得到零作爲計數
SELECT filters.text,
(SELECT COUNT(items.id)
FROM items
WHERE (items.title LIKE 'filters.text' OR
items.title LIKE '%filters.text' OR
items.title LIKE '%filters.text%' OR
items.title LIKE 'filters.text%')
) AS count
FROM filters, items
GROUP BY filters.ID
ORDER BY filters.ID DESC