![](/img/trans.png)
[英]How to display results of a query (with subqueries) where one of the columns can have more than one info using mysql and php?
[英]MySQL: How to get more results with this query WHERE IN
我的類別表
table concept_category:
id category_title
-----------------------------
1 category1_title
2 category2_title
3 category3_title
4 category4_title
5 category5_title
和帶有概念的表
table concept:
id catid title
-----------------------------
1 3,5 title concept1
2 5 title concept2
3 2 title_concept3
現在,我嘗試獲取catid為5的所有結果。但是,給出的結果僅為title_concept 2,並且我想要title_concept1和title_concept2。 這是我的查詢
SELECT id, title, catid
FROM concept
WHERE catid = (5)
我沒有看到自己在做什么錯..有人可以幫助我嗎?
SELECT id, title, catid
FROM concept
where find_in_set(5, replace(catid, ' ', '')) > 0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.