转贴自Lunar2000的专栏http://blog.csdn.net/lunar2000/
显示结果很有趣。
几个显示结果很有趣的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>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/32/viewspace-184130/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/32/viewspace-184130/