请各位大虾帮忙看看这个SQL语句哪里出错了,我查了半天都查不出来哪里出错。

zsucdy 2001-09-21 10:56:54
insert into MonthStatistics(MeterID,UserName,Zone,YearNum,MonthNum) select MeterID,UserName,Zone,2001,10 from UserTable
在Database desktop中运行的时候,提示如下错误:
Type mismatch in express
如果去掉YearNum和MonthNum两个字段的话,运行正常。
YearNum和MonthNum的类型都是long integer
还有,数据库是paradox7.0
...全文
88 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zsucdy 2001-09-22
  • 打赏
  • 举报
回复
谢谢machin(刷新一下)兄。
zenartus 2001-09-21
  • 打赏
  • 举报
回复
int
machin 2001-09-21
  • 打赏
  • 举报
回复

你改成这样的吧:

insert into MonthStatistics(MeterID,UserName,Zone,YearNum,MonthNum)
select MeterID,UserName,Zone,cast(2001 as int),cast(10 as int) from UserTable

我试过了,没问题。。。你试试看吧。。。。

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧