有趣的sql(3)
2004-07-26 10:51
441 查看
几个显示结果很有趣的SQL。
?
转贴自Lunar2000的专栏http://blog.csdn.net/lunar2000/?
?
?
一颗巨大的友谊之树 http://blog.csdn.net/lunar2000/archive/2004/07/26/51714.aspx
SQL> set pagesize 2000
SQL> select decode
? 2???????? ( sign(floor(maxwidth*2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth*2)-(rownum-1))
? 4?????????? || rpad( '*', 2*(rownum-1)+1, ' *')
? 5???????? , lpad( '* * *', floor(maxwidth*2)+3))
? 6? from all_objects
? 7???? , (select 20 as maxwidth from dual)
? 8? where rownum < floor(maxwidth*2) +5;
??????????????????????????????????????? *
?????????????????????????????????????? * *
????????????????????????????????????? * * *
???????????????????????????????????? * * * *
??????????????????????????????????? * * * * *
?????????????????????????????????? * * * * * *
????????????????????????????????? * * * * * * *
???????????????????????????????? * * * * * * * *
??????????????????????????????? * * * * * * * * *
?????????????????????????????? * * * * * * * * * *
????????????????????????????? * * * * * * * * * * *
???????????????????????????? * * * * * * * * * * * *
??????????????????????????? * * * * * * * * * * * * *
?????????????????????????? * * * * * * * * * * * * * *
????????????????????????? * * * * * * * * * * * * * * *
???????????????????????? * * * * * * * * * * * * * * * *
??????????????????????? * * * * * * * * * * * * * * * * *
?????????????????????? * * * * * * * * * * * * * * * * * *
????????????????????? * * * * * * * * * * * * * * * * * * *
???????????????????? * * * * * * * * * * * * * * * * * * * *
??????????????????? * * * * * * * * * * * * * * * * * * * * *
?????????????????? * * * * * * * * * * * * * * * * * * * * * *
????????????????? * * * * * * * * * * * * * * * * * * * * * * *
???????????????? * * * * * * * * * * * * * * * * * * * * * * * *
??????????????? * * * * * * * * * * * * * * * * * * * * * * * * *
?????????????? * * * * * * * * * * * * * * * * * * * * * * * * * *
????????????? * * * * * * * * * * * * * * * * * * * * * * * * * * *
???????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
???????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
???? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
SQL> set heading on
SQL> set feedback on
SQL>
?
?
一颗小小的柏
http://blog.csdn.net/lunar2000/archive/2004/07/26/51718.aspx
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading off
sys@TEST_LUNAR> set feedback off
sys@TEST_LUNAR> set pagesize 2000
sys@TEST_LUNAR>
sys@TEST_LUNAR> select decode
? 2???????? ( sign(floor(maxwidth/2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth/2)-(rownum-1))
? 4?????????? || rpad( chr(257), 2*(rownum-1)+1, ' ' || chr(257))
? 5???????? , lpad( chr(257) || chr(257) || chr(257), floor(maxwidth/2)+3))
? 6? from all_objects
? 7???? , (select 25 as maxwidth from dual)
? 8? where rownum < floor(maxwidth/2) +6;
???????????
??????????
?????????
????????
???????
??????
?????
????
???
??
?
????????
????????
????????
????????
????????
????????
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
sys@TEST_LUNAR>
?
红豆冰山
http://blog.csdn.net/lunar2000/archive/2004/07/26/51720.aspx
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR> set heading off
sys@TEST_LUNAR> set feedback off
sys@TEST_LUNAR> set pagesize 2000
sys@TEST_LUNAR>
sys@TEST_LUNAR> select decode
? 2???????? ( sign(floor(maxwidth/2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth/2)-(rownum-1))
? 4?????????? || rpad( '*', 2*(rownum-1)+1, ' *')
? 5???????? )
? 6? from all_objects
? 7???? , (select 10 as maxwidth from dual)
? 8? where rownum < floor(maxwidth/2) +1;
???? *
??? * *
?? * * *
? * * * *
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
?
?
心存感激
http://blog.csdn.net/lunar2000/archive/2004/07/26/51724.aspx
set heading off
set feedback off
set pagesize 2000
select t
from (select t, rownum rowcount from t) t
order by rowcount desc;
set heading on
set feedback on
SQL> select t
? 2? from (select t, rownum rowcount from t) t
? 3? order by rowcount desc;
T
--------------------------------------------------------------------------------
??? ((`'-"``""-'`))
???? )?? -??? -? (
??? /?? (o _ o)?? /
??? /??? ( 0 )??? /
??? _'-.._'='_..-'_
? /`;#'#'#.-.#'#'#;`/
? /_))??? '#'??? ((_/
??? #.? ☆ ☆ ☆?? #
??? '#.? 谢谢了! .#'
??? / '#.????? .#' /
?? _/? /'#. .#'/? /_
? (((___) '#' (___)
12 rows selected
SQL>
?
?
?
转贴自Lunar2000的专栏http://blog.csdn.net/lunar2000/?
?
?
一颗巨大的友谊之树 http://blog.csdn.net/lunar2000/archive/2004/07/26/51714.aspx
SQL> set pagesize 2000
SQL> select decode
? 2???????? ( sign(floor(maxwidth*2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth*2)-(rownum-1))
? 4?????????? || rpad( '*', 2*(rownum-1)+1, ' *')
? 5???????? , lpad( '* * *', floor(maxwidth*2)+3))
? 6? from all_objects
? 7???? , (select 20 as maxwidth from dual)
? 8? where rownum < floor(maxwidth*2) +5;
??????????????????????????????????????? *
?????????????????????????????????????? * *
????????????????????????????????????? * * *
???????????????????????????????????? * * * *
??????????????????????????????????? * * * * *
?????????????????????????????????? * * * * * *
????????????????????????????????? * * * * * * *
???????????????????????????????? * * * * * * * *
??????????????????????????????? * * * * * * * * *
?????????????????????????????? * * * * * * * * * *
????????????????????????????? * * * * * * * * * * *
???????????????????????????? * * * * * * * * * * * *
??????????????????????????? * * * * * * * * * * * * *
?????????????????????????? * * * * * * * * * * * * * *
????????????????????????? * * * * * * * * * * * * * * *
???????????????????????? * * * * * * * * * * * * * * * *
??????????????????????? * * * * * * * * * * * * * * * * *
?????????????????????? * * * * * * * * * * * * * * * * * *
????????????????????? * * * * * * * * * * * * * * * * * * *
???????????????????? * * * * * * * * * * * * * * * * * * * *
??????????????????? * * * * * * * * * * * * * * * * * * * * *
?????????????????? * * * * * * * * * * * * * * * * * * * * * *
????????????????? * * * * * * * * * * * * * * * * * * * * * * *
???????????????? * * * * * * * * * * * * * * * * * * * * * * * *
??????????????? * * * * * * * * * * * * * * * * * * * * * * * * *
?????????????? * * * * * * * * * * * * * * * * * * * * * * * * * *
????????????? * * * * * * * * * * * * * * * * * * * * * * * * * * *
???????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
???????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
???? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
??? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
?? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
? * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
????????????????????????????????????? * * *
SQL> set heading on
SQL> set feedback on
SQL>
?
?
一颗小小的柏
http://blog.csdn.net/lunar2000/archive/2004/07/26/51718.aspx
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading off
sys@TEST_LUNAR> set feedback off
sys@TEST_LUNAR> set pagesize 2000
sys@TEST_LUNAR>
sys@TEST_LUNAR> select decode
? 2???????? ( sign(floor(maxwidth/2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth/2)-(rownum-1))
? 4?????????? || rpad( chr(257), 2*(rownum-1)+1, ' ' || chr(257))
? 5???????? , lpad( chr(257) || chr(257) || chr(257), floor(maxwidth/2)+3))
? 6? from all_objects
? 7???? , (select 25 as maxwidth from dual)
? 8? where rownum < floor(maxwidth/2) +6;
???????????
??????????
?????????
????????
???????
??????
?????
????
???
??
?
????????
????????
????????
????????
????????
????????
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
sys@TEST_LUNAR>
?
红豆冰山
http://blog.csdn.net/lunar2000/archive/2004/07/26/51720.aspx
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR> set heading off
sys@TEST_LUNAR> set feedback off
sys@TEST_LUNAR> set pagesize 2000
sys@TEST_LUNAR>
sys@TEST_LUNAR> select decode
? 2???????? ( sign(floor(maxwidth/2)-rownum)
? 3???????? , 1, lpad( ' ', floor(maxwidth/2)-(rownum-1))
? 4?????????? || rpad( '*', 2*(rownum-1)+1, ' *')
? 5???????? )
? 6? from all_objects
? 7???? , (select 10 as maxwidth from dual)
? 8? where rownum < floor(maxwidth/2) +1;
???? *
??? * *
?? * * *
? * * * *
sys@TEST_LUNAR>
sys@TEST_LUNAR> set heading on
sys@TEST_LUNAR> set feedback on
sys@TEST_LUNAR>
?
?
心存感激
http://blog.csdn.net/lunar2000/archive/2004/07/26/51724.aspx
set heading off
set feedback off
set pagesize 2000
select t
from (select t, rownum rowcount from t) t
order by rowcount desc;
set heading on
set feedback on
SQL> select t
? 2? from (select t, rownum rowcount from t) t
? 3? order by rowcount desc;
T
--------------------------------------------------------------------------------
??? ((`'-"``""-'`))
???? )?? -??? -? (
??? /?? (o _ o)?? /
??? /??? ( 0 )??? /
??? _'-.._'='_..-'_
? /`;#'#'#.-.#'#'#;`/
? /_))??? '#'??? ((_/
??? #.? ☆ ☆ ☆?? #
??? '#.? 谢谢了! .#'
??? / '#.????? .#' /
?? _/? /'#. .#'/? /_
? (((___) '#' (___)
12 rows selected
SQL>
?
?
相关文章推荐
- 无组件上传图片到数据库中
- 初探数据仓库 转
- linux下使用脚本启动和关闭oracle
- MicroStrategy中 事实,实体,度量三个概念的区别及联系。
- RS.OPEN SQL,CONN,A,B 的理解
- Oracle9i与SYBASE ASE12.5相比的几个不足
- 使用组件封装数据库操作
- 使用类封装数据库操作
- oracle 部分函数
- 一个典型的sql注入漏洞
- oracle 9i pga使用控制
- 用Oracle8的层次查询生成BOM树的实现方法
- 关于服务器端数据访问(2)两种方法访问基于 SQL 的数据 :
- 预防SQL注入漏洞函数
- 大家来讨论通过牺牲存储空间来达到数据库存取性能的办法?
- 蛙蛙推荐:最近学t-sql的笔记,
- SQL数据库的一些攻击
- Transaction in Biztalk
- 在线SQLSERVER2000联机丛书
- 小技巧:用物理路径读取access数据库