合并两个SQL查询-无法在postgres中使用WHERE子句和between选项

时间:2019-03-11 05:35:47

标签: sql postgresql postgresql-9.1

我有以下两个SQL查询:

select * 
from table1 
where table1.item_no::character varying between '2000' and '3000' 
  and batch_id = 'new'

select * 
from table1 
where table1.item_no::int between '2000' and '3000' 
  and batch_id = 'new'

item_no数据类型是字符变化的。

如何在postgres中合并以上两个SQL查询?

0 个答案:

没有答案