win7专业版禁用u盘:SQL语句问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/10 10:09:41
从学生表中查找姓'王'的学生的名单怎么写语句?

select * from 学生表 where substring(姓名,1,2)='王'
应该是这样做了,建议:如果在学SQL的时候碰到什么问题,尽量去查SQL自带的联机丛书,上边比什么都全,什么问题都能找到答案.......谢谢!

select * from xs where name="王?"

select * from xs where left(姓名,1)=‘王’

select * from 表名
where name like '王%'

关键是使用like语句寻找和名字第一个字符是‘王’的匹配行