0

我正在尝试执行此查询,但它不喜欢它“它抛出以下异常”溢出一个 int 列。超出最大整数值。”不知道这里缺少什么

    select * from Schedwin.SEVT where 
ltrim(Resid)=345032 and type=5 or (type = 4 and subactid = 4)
or
(TYPE = 0)and (USER2='02-Force OT')
and ltrim(SEVT.t_start) <=  1215208800 
and ltrim(sevt.t_start) <=  1215207800
order by SEVT.TYPE

我不好的 t_start 数据类型是 char 所以我修改了我的查询,如下所示,它可以工作

    select * from Schedwin.SEVT where 
ltrim(Resid)=345032 and type=5 or (type = 4 and subactid = 4)
or
(TYPE = 0)and (USER2='02-Force OT')
and ltrim(SEVT.t_start) <= '1215208800' 
and ltrim(sevt.t_start) <= '1215207800'
order by SEVT.TYPE
4

2 回答 2

3

整数的大小为 4 个字节。您试图在一列中存储超过 4 个字节,使其溢出。使用bigintornvarchar作为该列的类型。:-) 改变表格。

于 2013-01-31T03:07:11.690 回答
1

允许的最高 INT 值为 2,147,483,647。检查您的 t_start 值是否超过允许的 INT 值

于 2013-01-31T03:07:56.503 回答