1、可以修改长度后再插入:
ALTER table t1 alter COLUMN gjj n(12,2)
2、或者先定义一个足够长度的临时表,然后查询插入
CREATE CURSOR T1 (XM C(10),GJJ N(12,2))
INSERT INTO t1 (xm,gjj) SELECT xm,gjj FROM gjj2015 WHERE xm in ('张三 ','李四 ','王五')
INSERT INTO t1 (xm,gjj) SELECT '合计',SUM(gjj) FROM t1
select xm,gjj from gjj2015 where inlist(alltrim(xm),'张三','李四','王五') ;
union select "合计",sum(gjj) from gjj2015 where inlist(alltrim(xm),'张三','李四','王五')
问题1
在VFP9下:
SELECT xm,tot1 FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳') ;
UNION select '合计',SUM(tot1)FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳')
上述语句结果‘合计’在中间
问题1
在VFP9下:
SELECT xm,tot1 FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳') ;
UNION select '合计',SUM(tot1)FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳')
改为
SELECT xm,tot1 FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳') into cursor temp readwrite
insert into temp select '合计',SUM(tot1)FROM bmk0651 WHERE INLIST(xm,'叶镔','景淼钦','陈晶佳')