Mysql 复杂的自然连接 Select 语句

Mysql Complicated Natural Join Select Statement

我正在尝试在具有特定顺序和特定范围的两个表上创建自然连接。

我的桌子

dictionary
+-------+------------------+------+-----+---------+----------------+
| Field | Type             | Null | Key | Default | Extra          |
+-------+------------------+------+-----+---------+----------------+
| wid   | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| word  | varchar(56)      | NO   | UNI | NULL    |                |
+-------+------------------+------+-----+---------+----------------+

g219
+-------+------------------+------+-----+---------+----------------+
| Field | Type             | Null | Key | Default | Extra          |
+-------+------------------+------+-----+---------+----------------+
| pos   | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| wid   | int(10) unsigned | NO   | MUL | NULL    |                |
+-------+------------------+------+-----+---------+----------------+

dictionary 有一组唯一(区分大小写)单词和标签的字典,每个单词和标签都分配有一个 ID 号。 g219本质上是一本书,其中pos是书中word/tag的位置,wid是字典中对应的单词id。我可以执行一个完整的自然连接来布置这本书,如下所示:

SELECT word FROM dictionary
    NATURAL JOIN g219
    ORDER BY g219.pos;

我也可以通过添加 LIMIT [n] 来应用限制,但这只是 returns 第一个 [N] 结果。我不知道如何将其限制在指定范围内。两者

SELECT word FROM dictionary
    NATURAL JOIN g219
    ORDER BY g219.pos
    WHERE pos BETWEEN 50 AND 100;

SELECT word FROM dictionary
     NATURAL JOIN g219
     ORDER BY g219.pos
     WHERE pos > 50 AND pos < 100;

失败。

先是"WHERE",然后是"ORDER BY";)