开发者

How to use between in MySQL ansi query?

I need to query something using INNER JOIN, how can I use WHERE user_id between 2000 and 3000 inside ANSI query

e.g.

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

also, I need to l开发者_如何学Pythonimit table2.wage between 2000 and 4000 how can I represent it


Well, a BETWEEN x AND y is nothing else then ( a >= x AND a <= y ), so

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

should do

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜