用户表:
userID | name
1 | John
2 | Mary
3 | Jack
项目表(用户将选择并存储到 mysql
itemID | name | item
1 | Mary | pants, jeans
1 | John | jacket, shirt
1 | Jack | jacket, shirt
描述表(根据用户选择的项目检索描述)
descID | item | descOne | descTwo
1 | jacket, shirt | Nice! | Great
1 | pants, jeans | good | Nice
1 | dress, jeans | Nice! | Great
如果我想检索 Mary 的值,我的 select sql 语句应该是什么?
目前我有这个->
SELECT
d.item,
d.descOne,
d.descTwo,
i.name , d.item
FROM description d
INNER JOIN items i
WHERE d.item = i.item ON;