对于简约标题感到抱歉,但我不知道如何描述它.我有三张桌子:
组表
ID | Genre
-----------------
1 | Action
2 | Adventure
3 | Drama
很多很多桌子
GroupID | ElementID
-----------------
3 | 1
1 | 2
2 | 2
2 | 3
3 | 3
和元素表
ID | Element
-----------------
1 | Pride and Prejudice
2 | Alice in Wonderland
3 | Curious Incident Of A Dog In The Night Time
一切都很好,非常简单.我想要实现的SELECT如下
ID | Element | Genre
-------------------------------------------------------------
1 | Pride and Prejudice | Drama
2 | Alice in Wonderland | NULL
3 | Curious Incident Of A Dog In The Night Time | Drama
我想从表Elements中选择所有元素,并将类型字段设置为Drama或null.
我试图在MySQL中这样做.
先谢谢你