用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
oldwain的公告
<FONT color=#ff3300>今天起将俺的BLOG搬到:<a href="http://oldwain.itpub.net/">oldwain.itpub.net</a> 这里的blog今天起停止更新。 </FONT> <p> <p> <a href="http://blogshares.com/blogs.php?blog=http%3A%2F%2Fblog.csdn.net%2Foldwain%2F&user=22167"><img src="http://blogshares.com/images/blogshares.jpg" alt="Listed on BlogShares" width="117" height="23"/></a> <p> <center><img src='http://blog.csdn.net/images/blog_csdn_net/oldwain/17157/t_guanshui6.gif'></center> 当前访问次数:<p> <script src="http://www.xcinfo.ha.cn/jsq/default.asp?User=oldwain&Length=6&x=15&y=20&Mode=028"></script> </script> <p> <a id="SingleColumn1_Categories_CatList__ctl3_LinkList__ctl1_Link" href="http://appnews.qq.com/cgi-bin/news_qq_search?city=%c4%cf%be%a9" target="_blank"><iframe width=157 height=240 frameborder=0 scrolling=NO src='http://appnews.qq.com/cgi-bin/news_qq_search?city=%b1%b1%be%a9'></iframe></a> <p> 与我联系:<a href="mailto:oldwain+csdnblog@gmail.com" target=_blank>我的EMAIL</a>
文章分类
IT-oracle
ITPUB
ORACLE中国用户讨论组
IT-other
CSDN(在csdn开的blog,不加入觉得不好意思:) )
stock
中天网
和讯
个人站点/blog
biti_rainy的专栏 (RSS)
eygle的专栏(RSS)
Fenng的专栏(RSS)
Kamus的专栏 (RSS)
lunar的小铺(RSS)
Piner的专栏(RSS)
snowhite2000的专栏(RSS)
花香满径(RSS)
存档

原创  有趣的sql(3) 收藏

几个显示结果很有趣的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>

?

?

发表于 @ 2004年07月26日 10:51:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:有趣的sql(2) | 新一篇:关于Oracle的笑话

  • 发表评论
  • 评论内容:
  •  
Copyright © oldwain
Powered by CSDN Blog