0
0 72十七點37分20秒呼叫new_procedure錯誤代碼:1292截斷不正確 INTEGER值: '_3_ELECTRICITY BILL_3.pdf' 0.140秒截斷不正確INTEGER值而插入到臨時表的MySQL
注意:3_ELECTRICITY BILL_3.pdf
值包含tbl_AccountOpeningForm
表中AttachmentName
列
,但如果我從查詢中移除having clause
它做工精細。
tbl_AccountOpeningForm
CustNo VARCHAR(80)
AttachmentName VARCHAR(100)
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`()
BEGIN
drop table if exists tblReport;
create temporary table tblReport
(
CustNo varchar(80)
) ;
insert into tblReport (CustNo)
select CustNo
from tbl_AccountOpeningForm
group by CustNo
having COUNT(case when LTRIM(RTRIM(AttachmentName))='' then null else AttachmentName end)!=
COUNT(case when LTRIM(RTRIM(AttachmentName))!='' then null else AttachmentName end) limit 10000000;
select * from tblReport;
END
非常感謝...而且...... Clever @Gordon –