Is there an infinity or wild card for use of BETWEEN ranges with MySQL?

0
425

i would suggest using this when lower == null then it will be replaced by 0 and when upper is null then it will be replaced by a max bigint

SELECT * FROM `mytable` WHERE 50 between ifnull(lower,0) and ifnull(upper,~0)

LEAVE A REPLY

Please enter your comment!
Please enter your name here