有一个字段叫studentnum(学号)我想查出学生学号前7位为0203001的所有学生。请问应该怎么写,我这么写有什么错误吗?
select * from student where copy(studentnum,1,7)=0203001.
请大家给个正确的写法,谢谢!
select * from student where copy(studentnum,1,7)=0203001.
请大家给个正确的写法,谢谢!
解决方案 »
- 急!急!
- 安装了水晶报表,怎么控件上没显示这个组件啊??
- 三层Midas的简单例子,客户端和服务器端在同一台电脑运正常,在网内不同的电脑上客户端查寻SQL提示'拒绝访问',是怎么回事?
- Frame中除了加控件,能添加自己的代码吗??
- 讨论:Fast report 3.02 的新特性!!!
- 怎么使用BoundsChecker查看一个可执行文件的API调用顺序
- 寻找无锯齿的图片中心旋转 方法(可形成连续旋转)
- 如何实现BMP和JPG的互换
- 如何用一个sql语句。。。。
- 问题:我们程序员能活多久
- 怎么样在Dbgrid中实现按住shift键把鼠标点选两个位置之间的记录全部选中,像Excel那样
- 文字特效处理
sql.text:='select * from student where substring(ststudentnum,1,7)='''+'0203001'+''''
应该按 cangwu_lee(小橙子)
select * from student where ststudentnum LIKE '0203001%'
的写法.
select * from student where copy(studentnum,1,7)='0203001'
也行,不过要加'',因为是字符型.