我必须处理这样的查询:
SELECT some_col FROM some_table WHERE id BETWEEN 0 AND 50000000;
如果边界值可以用不同的方式表达,那么读取代码会更容易,例如:
SELECT some_col FROM some_table WHERE id BETWEEN 0 AND 50 000 000;
SELECT some_col FROM some_table WHERE id BETWEEN 0 AND 50M;
这可能吗?
答案 0 :(得分:0)
这有效:
SELECT some_col FROM some_table WHERE id BETWEEN 0 AND REPLACE('50 000 000', ' ', '');
SELECT some_col FROM some_table WHERE id BETWEEN 0 AND REPLACE('50M', 'M', '000000');