select * from test where tid like '%4'; 没记错应该是这样写的.
select * from test where tid like '__14';
正解,这个好像很基础啊,楼主。 select * from test where tid like '%14';
SQL>select * from table where mod(tid, 100)=14;或者SQL>select * from table where to_char(tid) like '%14';
select * from test where tid like '%14'; 基础的东西
两种都可以 select * from test where tid like '%14'; select * from test where tid like '__14'; __ 是两个_
综合一下 select * from test where tid like '%14'; select * from test where tid like '__14';——两个_ select * from test where mod(tid,100) = 14; select * from test where to_char(tid) like '%14';
select * from test where tid like '%4';
模糊查询,基础的东西 select * from test where tid like '%14';
使用通配符 % 和 _都可以实现,like '%14' 或者 like '__14',如他们所说,是两个下划线
我也补充一个 select * from test where substr(tid,-2)= '14'
SQL>select * from table where mod(tid, 100)=14; 或者 SQL>select * from table where to_char(tid) like '%14'
select * from table where to_char(tid) like '%14'
恩 在楼主这个数据表里 select * from test where tid like '%4'; select * from test where tid like '%14'; select * from test where tid like '%014'; 都能达到过滤以 14 结束的记录。
不就是 模糊查询select * from tab where tid like '%14';
select * from test where tid like '%14'; 这个很基础!
SQL>select * from table where mod(tid, 100)=14; 或者 SQL>select * from table where to_char(tid) like '%14';
楼上的真是,简单的语句,这里太热情了呵呵select * from test where tid like '%14'; select * from test where tid like '__14';
select * from test where tid like '__14'; 这句最合适。四位长度嘛
select * from test where tid like '%4';
select tid from test where tid like '%14';
select tid from test where instr(tid,'14')>length(tid)-2 再建基于函数的索引,效率应该可以提高
没记错应该是这样写的.
select * from test where tid like '%14';
SQL>select * from table where mod(tid, 100)=14;或者SQL>select * from table where to_char(tid) like '%14';
基础的东西
select * from test where tid like '%14';
select * from test where tid like '__14';——两个_
select * from test where mod(tid,100) = 14;
select * from test where to_char(tid) like '%14';
select * from test where tid like '%14';
因为规定了长度,所以第2个也可以,‘%’‘_’是oracle 里面的两个通配符,前者表示任意多个字符,后者表示任意一个字符。
select * from test where substr(tid,-2)= '14'
select * from test where tid like '%4';
select * from test where tid like '%14';
select * from test where tid like '%014';
都能达到过滤以 14 结束的记录。
这个很基础!
这句最合适。四位长度嘛
再建基于函数的索引,效率应该可以提高