select systemname,to_char(a.starttime,'yyyy') as year from dual where year='2010' 如果运行这句话会报错,说year标签不存在,我想问一下大家,用什么方法才能让我用到year这个字段,除了where to_char(a.starttime,'yyyy')=‘2010’这种写法
解决方案 »
- 为什么我在 win2008 for 64 的机器上装了 oracle 11g 占用16G内存
- 50分在线求解(有合适答案+50),ORA-01502疑难问题
- oracle存储过程效率问题
- sql/plus中调用存储过程总失败?
- 共享服务器?专用服务器?
- Oralce C++编程资料与书籍搜索
- 为什么别人访问不了我机器上的Oracle服务?
- 关于备份,字段名里有中划线,备份要做些什么处理吗(在线)
- Oracle 8.1.7 personal edition 为什么不能在WINDOWS 2000 PROFESSIONAL 上安装? 急!
- 多表(两个以)全外联接,sql怎么写,不用UNION,
- sql 如何获取oracle中clob的值
- rman backup database命令
select systemname,to_char(a.starttime,'yyyy') as "year" from dual where year='2010' ;
--不好意思 上面理解错了,需要再嵌套一层
SELECT * FROM (
select systemname,to_char(a.starttime,'yyyy') as year from dual )
where year='2010'
--还得嵌套一层select systemname,to_char(a.starttime,'yyyy') as year from dual where year='2010'select systemname,to_char(a.starttime,'yyyy') as year
from 正确的表名
where to_char(a.starttime,'yyyy')='2010'
--or
select * from
(select systemname,to_char(a.starttime,'yyyy') as year
from 正确的表名)
where where year='2010'
------使用Oracle extract函数提取年月日多么好的东西 ,example:
select extract(year from sysdate) from dual ;select systemname,extract(year from a.starttime) as year from dual where extract(year from a.starttime) =2010
select extract(year from sysdate) from dual
----------------------------------------------
2010