SELECT ... INTO截断了双精度值错误

时间:2018-07-20 19:39:00

标签: mysql double select-into

我正在尝试执行以下操作

set @STARTDATE = '2018/06/01 00:00:00';
set @ENDDATE ='2018/06/30 23:59:59';   
set @i_id = aaa;


select count(distinct rj.policy) into @rp from rps rj
inner join sentps sp
on rj.p = sp.p
where 
rj.entry_date between @startdate and @enddate
and sp.start_date between @startdate and @enddate
and rj.i_id = @i_id
and code1 like 'w%'
and datediff(rj.Entry_date, sp.start_date) >= 14;
select @rp as rpl

由于truncated double value error,脚本返回的值为0,但是,如果我删除了into @rp,脚本将正常工作并返回正确的值。 into @RP是整个脚本的组成部分,稍后将在百分比计算中使用。任何建议将不胜感激

0 个答案:

没有答案