今天遇到了个特别奇怪的问题,请教大家,问题描述如下:
查询这条语句:
select E0101,MC0000 from E01 where DEPT_CODE =11101010114
得到如下结果:
消息 8115,级别 16,状态 8,第 1 行
将 varchar 转换为数据类型 numeric 时出现算术溢出错误。
-------------
查询这条语句:
select ......
表 Table 列 A 列中有 类型 为1 为2 为3 .....
显示类型为 1 的合计 2 的合计 3 的合计 .....
显示所有类型 1 2 3 ...
SQL code:
select count(类型) from A group by 类型
??
group by a with cube
SQL code:
SELECT SUM(A) fro ......
表trans(transID,lastDate)
表Transdetail(transID,voidDate)
我要的效果是,当lastDate=voidDate时,UPDATE表TransDetail中的TransID跟Trans中的transID一样
update Transdetail as a
set TransID=(select transID from Trans where lastDate=a.voidDate)
update TransDetail t set t.transID=(select ......
A表(主表)
A1(主键) A2
1 张三
B表
B1(外键) B2
1 ZHONG
1 GUO
C表
C1(外键) C ......
tabA表有两个字段 Detail和Aguid,indentcost
具体表的数据如下
detail Aguid indentcost
15L B74665ED-5ADC-304C-B31C-B10ECA27810A 10290
6L B74665ED-5ADC-304C-B31C- ......
sql求写法
表1:
字段名:f1 f2
1 b1
2 b2
3 b3
表2:
字段名:f1 f2 f3
1 c1 1
1 c2 2
2 c3 ......