开发者

SQL Left Join (Between Condition)

Is it possible to use a BETWEEN statement as开发者_运维百科 a condition for a LEFT JOIN?

SELECT Table_1.*, Table_2.*
FROM Table_1 LEFT JOIN Table_2
ON Table_1.value BETWEEN Table_2.Value_1 AND Table_2.Value_2


Yes, it is, but you need to specify a column name from Table_1, like so:

SELECT Table_1.*, Table_2.*
FROM Table_1 LEFT JOIN Table_2
ON Table_1.Value BETWEEN Table_2.Value_1 AND Table_2.Value_2
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜