oracle积累继续
2013-09-03 16:49
155 查看
选出当天的日期的数据
select * from test_table where to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd');
要想改变查询的结果,可以用 (case when then else end) as 句式
select (case when to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd') then '今日' else '非今日' end) as datetime, shengfu from test_table;
repalce用法
replace(c1, c2, c3)
从c1字符串中找到c2字符,替换成c3字符
lpad用法
lpad(c1, length, c3)
返回没有length长,用c3再左边补齐
比length长,从右边截断
选两张表,结合
select t1.sname||'_VS_'||t2.sname from qiudui t1, qiudui t2 where t1.sname<>t2.sname;
select * from test_table where to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd');
要想改变查询的结果,可以用 (case when then else end) as 句式
select (case when to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd') then '今日' else '非今日' end) as datetime, shengfu from test_table;
repalce用法
replace(c1, c2, c3)
从c1字符串中找到c2字符,替换成c3字符
lpad用法
lpad(c1, length, c3)
返回没有length长,用c3再左边补齐
比length长,从右边截断
选两张表,结合
select t1.sname||'_VS_'||t2.sname from qiudui t1, qiudui t2 where t1.sname<>t2.sname;
相关文章推荐
- 积累的oracle操作
- Oracle RMAN Recover中使用BBED 跳过缺失的归档 继续 Recover 的测试
- oracle 日常积累
- oracle学习积累
- oracle数据库开发的一些经验积累
- oracle自定义函数积累
- oracle积累
- 使用database control 配置数据库时,要求在当前oracle主目录中配置监听程序,必须运行Netca以配置监听程序,然后才能继续。或者可以选择继续,但是不要使用database cont
- Oracle数据库开发的一些经验积累
- oracle[点滴积累]
- 积累的oracle操作
- 一句话ORACLE经验积累(20071113)
- ORACLE-日期的使用(知识积累)
- 平时积累的oracle语句
- Oracle实用SQL查询函数积累
- oracle 的一些平时常用知识积累(从创建空间、数据库备份和导入、plsql连接使用全过程)
- oracle转mysql中的一些注意点(后面会继续添加)
- 积累小知识 (Oracle)
- Oracle RMAN Recover中使用BBED 跳过缺失的归档 继续 Recover 的测试
- oracle的sql积累