select该如何写? select * from table where f1>=3 order by f1union select * from table where f1 in (1,2) order by f1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tbname order by decode(f1,1,99999998,2,99999999,f1); select * from table where f1>2 order by f1union select * from table where f1<3 order by f1 select * from table where f1>2 order by f1union select * from table where f1<3 order by f1不行,报错。ORA-00933 SQL command not properly ended 用这个可以,不过就是有点缺陷select * from tbname order by decode(f1,1,99999998,2,99999999,f1);不知道表里的f1值会不会超过指定的数99999999 ORDER BY不能这么用。只能在UNION后用一次。如:select * from table where f1>2 union select * from table where f1<3 order by 1 怕F1超过99999999的,可以这样:select * from tbname order by decode(f1,1,'a',2,'b',f1); 谢谢各位,另外,sybase有类似的decode的函数吗? ORACLE生产库到测试环境 一个表的效率问题 存储过程中求一个字符串的所有子串,该如何实现 两个sql语句执行结果不一样???请教高手!!!!!!! 这个语句该怎么写? 简单问题求助:报错:“ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小” 熟悉pl/sql developer的进来帮个忙,谢谢。 跪着在线等,关于oracle not available问题 一个关于导入\导出的问题 急,关于快照和触发器 关于VC下通过OCI连接ORCALE的一个问题 列表中具有指定参数的多个例程
union
select * from table where f1<3 order by f1
union
select * from table where f1<3 order by f1
不行,报错。ORA-00933 SQL command not properly ended
select * from tbname order by decode(f1,1,99999998,2,99999999,f1);
不知道表里的f1值会不会超过指定的数99999999
只能在UNION后用一次。
如:
select * from table where f1>2
union
select * from table where f1<3 order by 1
select * from tbname order by decode(f1,1,'a',2,'b',f1);