【发布时间】:2017-07-24 03:26:05
【问题描述】:
我有以下表格:
表格:单词
id word
1 a
2 b
3 c ... so on
表格:定义
id wid land definition
1 1 en the first letter of the Roman alphabet
2 1 en the blood group "A"
3 1 my Definition of 'a' in Malaysia
4 1 sg Definition of 'a' in Singapore
5 2 en the second letter....
6 2 en the blood group "B"
7 2 my Definition of 'b' in Malaysia
8 2 sg Definition of 'b' in Singapore
.... and so on.
我的目标是找到一个在特定语言中没有定义的词,这样我就可以添加定义。在这种情况下,我想拉出“c”这个词。
所以当我尝试时:
"SELECT word FROM words, definition WHERE words.id = wid AND lang != 'my'
我得到所有单词:“a”、“b”和“c”。
我该如何解决这个问题?
【问题讨论】:
-
对不起,我的问题不是很清楚!在我上面的例子中,“c”这个词可能有其他语言的定义。所以我的问题是选择没有特定语言定义的单词。
-
它给了我在“我的”语言中有定义的单词,即使我尝试使用 where language != 'my'。抱歉,我在这里处理标记问题。
-
@Lian 以后当你有mysql问题的时候,请提供一个sqlfiddle链接,里面包含了所有必要的db表。这样可以让志愿者快速回答你的问题,并且有很高的信心和准确性。