请教sql语句中的小问题 translate(字段A,'123','111') like '1%'这种做法,仅限在比较一个字符开头的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢 ORARichard(没钱的日子......),不过好像不是我要求的结果。另外 translate 是什么意思? SQL> select * from zt;A B---------- ----------1001 11002 22001 33001 44001 55001 64002 6SQL> select * from zt where substr(a,1,1) = 1 or substr(a,1,1) = 2 or substr(a,1,1) = 3; 你可以把OR改成UNION ALL语句。A B---------- ----------1001 11002 22001 33001 4或者:SQL> select * from zt where decode(substr(a,1,1),1,'@',2,'@',3,'@',a) = '@';A B---------- ----------1001 11002 22001 33001 4 translate(substr(字段A,1,1),'123','111') ='1'orsubstr(字段A,1,1) in ('1','2','3') 如何查找那些sql效率低 SQL%COUNT的问题 有关oracle instantclient 创建odbc的问题 proc中如何操纵timestamp 数据 对一个表执行SELECT语句后得到一个结果集,如何从这个结果集中得到这个表的所有字段名和所有字段的类型? oracle 10g em无法启动 oracle备份 装oracle9i时:要想安装pl/sql 按照哪个安装选项安装? 为什么自已的存储过程里不能调用别人建的表 安装oralce8.1.7时出来错误! 请问什么是 PL/SQL? 优化sql语句的问题,只是sql语句的优化不用索引和视图索引或一些数据库高级属性 谢谢
另外 translate 是什么意思?
---------- ----------
1001 1
1002 2
2001 3
3001 4
4001 5
5001 6
4002 6SQL> select * from zt where substr(a,1,1) = 1 or substr(a,1,1) = 2 or substr(a,1,1) = 3;
你可以把OR改成UNION ALL语句。A B
---------- ----------
1001 1
1002 2
2001 3
3001 4或者:
SQL> select * from zt where decode(substr(a,1,1),1,'@',2,'@',3,'@',a) = '@';A B
---------- ----------
1001 1
1002 2
2001 3
3001 4