如何在pb中转变数据库中的数据类型

xiaofeng1 2003-10-15 07:23:01
在pb中如何将数据库中的char类型转变成int型
例如 在sql语言中可以用cast( as )转变
检索一年级学生
select count(xh)//xh 学号
from student
where 2003-cast(rxnd as int)=1 //rxnd 入校年度 char类型
在pb中没有cast()函数怎么办?指教
在pb中我试图这样写
select count(xh)//xh 学号
from student
where 2003-int(rxnd)=1
但是结果不正确。
...全文
71 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
雷米特大力神 2003-10-17
  • 打赏
  • 举报
回复
用convert()函数啊,convert(int(4),rxnd)
yjhyn 2003-10-17
  • 打赏
  • 举报
回复
函数?就是写一个函数,功能是实现将char转换成int型吗??
liliang800207 2003-10-15
  • 打赏
  • 举报
回复
支持longdrang(GodDragon
longdrang 2003-10-15
  • 打赏
  • 举报
回复
select count(xh)
from student
where 2003 - to_number(rxnd)=1;

to_number()函數

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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