关于数据库的检索问题

studysuneck 2005-03-22 06:03:38
字段“年”为字符型,可我现在要想查看1999年以前的数据,怎么用select语句?
select * from 表名 where 年=“1993”
本人用的是delphi 7
...全文
57 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sicrosoft 2005-03-23
  • 打赏
  • 举报
回复
相同的情况我也遇到过,采用楼上的第三条即可解决!
select * from 表名 where 年<'1993'
leeshine 2005-03-22
  • 打赏
  • 举报
回复
1. select * from 表名 where cast(年 as int)<1999
2. select * from 表名 where convert(int , 年)<1993
3. select * from 表名 where 年<'1993'
chinaandys 2005-03-22
  • 打赏
  • 举报
回复
select * from 表名 where cast(年 as int)<1993

2,498

社区成员

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

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