我需要使用 INNER JOIN 查询某些内容,如何在 ANSI 查询中使用 WHERE user_id between 2000 和 3000
例如
SELECT table1.name, table2.wage, table2.bonus table3.shift, table4.vacation
FROM table1
INNER JOIN table2 ON table1.userid = table2.userid
INNER JOIN table3 ON table2.userid = table3.userid
INNER JOIN table4 ON table4.userid = table4.userid
LEFT JOIN table5 ON table1.name = table5.position
另外,我需要将 table2.wage 限制在 2000 到 4000 之间,我该如何表示它
最佳答案
嗯,a BETWEEN x AND y
就是这样 ( a >= x AND a <= y )
,所以
WHERE ( user_id >= 2000 AND user_id <= 3000 )
应该做
关于mysql - 如何在 MySQL ansi 查询中使用 Between ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6897133/