0

我需要使用 INNER JOIN 查询一些东西我如何WHERE user_id between 2000 and 3000在 ANSI 查询中使用

例如

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 bwtween 2000 限制为 4000 我该如何表示它

4

1 回答 1

1

那么,a BETWEEN x AND y没有别的( a >= x AND a <= y )了,所以

WHERE ( user_id >= 2000 AND user_id <= 3000 )

应该做

于 2011-08-01T10:35:04.900 回答