oracle 如何查找特定字母开头的某个字段?
2022-12-11 · 百度认证:北京惠企网络技术有限公司官方账号
1、创建测试表,
create table test_teacher(teacher_no varchar(30) , teacher_name varchar(30));
2、插入测试数据
insert into test_teacher values('T20150101','陈xx');
insert into test_teacher values('20150101','王xx');
insert into test_teacher values('T20150133','李xx');
insert into test_teacher values('20150122','朱xx');
insert into test_teacher values('T20150156','张xx');
insert into test_teacher values('T20150188','六xx');
commit;
3、查询表中全量数据,select t.* from test_teacher t;
4、编写sql,找出所有的不是T开头的记录; select t.*, rowid from test_teacher t where t.teacher_no not like 'T%';