<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業(yè)精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評論 :: 0 Trackbacks
    打印五環(huán)和五角星的SQL代碼
    ?
    ?
    ??? 大牛寫的這兩段SQL實在是太銷魂了,實在是忍不住要轉(zhuǎn)載過來,留著以后慢慢看,太牛了……
    ??? http://www.itpub.net/viewthread.php?tid=981654&extra=&page=1
    ?
    ?
    ?
    with a as (select distinct round(a.x + b.x) x,round(a.y + b.y) y from
    (select (sum(x) over(order by n)) x,
    ??????????????????????????? round(sum(y) over(order by n)) y
    ????????????? from (select n, cos(n/30 * 3.1415926)*2? x,
    ?????????????????????????? sin(n/30 * 3.1415926) y
    ?????????????????????????? from (select rownum - 1 n from all_objects where rownum <= 30 +30))) a,
    ??????????? (select n, (sum(x) over(order by n)) x,
    ??????????????????????????? round(sum(y) over(order by n)) y
    ????????????? from (select n,
    ?????????????????????????? cos( m /3 * 3.1415926) * 2 * 15 x,
    ?????????????????????????? sin( m /3 * 3.1415926)* 15 y
    ????????????????????? from (select case when rownum <= 2 then 3
    ????????????????????? when rownum = 3 then -2 else -6 end m, rownum - 1 n
    ????????????????????????????? from all_objects where rownum <= 5))) b
    ????????? )
    select replace(sys_connect_by_path(point, '/'), '/', null) star
    ? from (select b.y, b.x, decode(a.x, null, ' ', '*') point
    ????????? from a,
    ?????????????? (select *
    ????????????????? from (select rownum - 1 + (select min(x) from a) x
    ????????????????????????? from all_objects
    ???????????????????????? where rownum <= (select max(x) - min(x) + 1 from a)),
    ?????????????????????? (select rownum - 1 + (select min(y) from a) y
    ????????????????????????? from all_objects
    ???????????????????????? where rownum <= (select max(y) - min(y) + 1 from a))) b
    ???????? where a.x(+) = b.x
    ?????????? and a.y(+) = b.y)
    where x = (select max(x) from a)
    start with x = (select min(x) from a)
    connect by y = prior y
    ?????? and x = prior x + 1;
    ?
    ?

    ????????????? * * * * * *?????????????????? * * * * * *?????????????????? * * * * * *?????????????
    ????????? * *???????????? * *?????????? * *???????????? * *?????????? * *???????????? * *?????????
    ?????? * *?????????????????? * *???? * *?????????????????? * *???? * *?????????????????? * *??????
    ???? *?????????????????????????? * *?????????????????????????? * *?????????????????????????? *????
    ?? **??????????????????????????? ***?????????????????????????? ***??????????????????????????? **??
    ? *???????????????????????????? *?? *???????????????????????? *?? *???????????????????????????? *?
    *???????????????????????????? *???? *?????????????????????? *???? *???????????????????????????? *
    *???????????????????????????? *???? *?????????????????????? *???? *???????????????????????????? *
    *???????????????????????????? *?????? *???????????????????? *?????? *???????????????????????????? *
    *???????????????????????????? *?????? *???????????????????? *?????? *???????????????????????????? *
    *???????????????????????????? *?????? *???????????????????? *?????? *???????????????????????????? *
    *???????????????????????????? *?????? *???????????????????? *?????? *???????????????????????????? *
    *???????????????????????????? *???? *?????????????????????? *???? *???????????????????????????? *
    *?????????????????????????? * * * * * *?????????????????? * * * * * *?????????????????????????? *
    ? *????????????????????? * *??? *?? *??? * *?????????? * *??? *?? *??? * *????????????????????? *?
    ?? *????????????????? * *??????? * *??????? * *???? * *??????? * *??????? * *????????????????? *??
    ??? **????????????? *??????????? ***??????????? * *??????????? ***??????????? *????????????? **???
    ?????? *????????? **?????????? *???? *????????? ***????????? *???? *?????????? **????????? *??????
    ???????? ** *??? *??????? * **???????? ** *??? *?? *??? * **???????? ** *??????? *??? * **????????
    ????????????? * * * * * *?????????????????? * * * * * *?????????????????? * * * * * *?????????????
    ??????????????? *???????????????????????????? *???? *???????????????????????????? *???????????????
    ?????????????? *???????????????????????????? *?????? *???????????????????????????? *??????????????
    ?????????????? *???????????????????????????? *?????? *???????????????????????????? *??????????????
    ?????????????? *???????????????????????????? *?????? *???????????????????????????? *??????????????
    ?????????????? *???????????????????????????? *?????? *???????????????????????????? *??????????????
    ??????????????? *???????????????????????????? *???? *???????????????????????????? *???????????????
    ??????????????? *???????????????????????????? *???? *???????????????????????????? *???????????????
    ???????????????? *???????????????????????????? *?? *???????????????????????????? *????????????????
    ????????????????? *???????????????????????????? * *???????????????????????????? *?????????????????
    ?????????????????? **?????????????????????????? ***?????????????????????????? **??????????????????
    ????????????????????? *?????????????????????? *???? *?????????????????????? *?????????????????????
    ??????????????????????? ** *???????????? * **???????? ** *???????????? * **???????????????????????
    ???????????????????????????? * * * * * *?????????????????? * * * * * *????????????????????????????
    ?
    ?
    with a as (
    ??????????? select distinct round(sum(x) over(order by n)) x,
    ??????????????????????????? round(sum(y) over(order by n)) y
    ????????????? from (select n,
    ?????????????????????????? cos(trunc(n / 20) * (1-1/5) * 3.1415926) * 2 x,
    ?????????????????????????? sin(trunc(n / 20) * (1-1/5) * 3.1415926) y
    ????????????????????? from (select rownum - 1 n from all_objects where rownum <= 20 * 5))
    ????????? )
    select replace(sys_connect_by_path(point, '/'), '/', null) star
    ? from (select b.y, b.x, decode(a.x, null, ' ', '*') point
    ????????? from a,
    ?????????????? (select *
    ????????????????? from (select rownum - 1 + (select min(x) from a) x
    ????????????????????????? from all_objects
    ???????????????????????? where rownum <= (select max(x) - min(x) + 1 from a)),
    ?????????????????????? (select rownum - 1 + (select min(y) from a) y
    ????????????????????????? from all_objects
    ???????????????????????? where rownum <= (select max(y) - min(y) + 1 from a))) b
    ???????? where a.x(+) = b.x
    ?????????? and a.y(+) = b.y)
    where x = (select max(x) from a)
    start with x = (select min(x) from a)
    connect by y = prior y
    ?????? and x = prior x + 1;



    ??????????????????? *???????????????????
    ?????????????????? * *??????????????????
    ?????????????????? * *??????????????????
    ????????????????? *?? *?????????????????
    ???????????????? **?? **????????????????
    ??????????????? *?????? *???????????????
    ??????????????? *?????? *???????????????
    * * * * * * * *** * * * *** * * * * * * *
    ? **????????? *?????????? *????????? **?
    ???? **?????? *?????????? *?????? **????
    ??????? *??? *???????????? *??? *???????
    ????????? ** *???????????? * **?????????
    ??????????? ** *???????? * **???????????
    ?????????? *??? * *?? * *??? *??????????
    ?????????? *?????? * *?????? *??????????
    ????????? *????? * * * *????? *?????????
    ???????? *??? * *?????? * *??? *????????
    ???????? *? *?????????????? *? *????????
    ??????? ** *???????????????? * **???????
    ??????? *?????????????????????? *???????
    ?
    ?
    ?
    ?
    posted on 2008-11-01 19:47 decode360 閱讀(420) 評論(0)  編輯  收藏 所屬分類: 05.SQL
    主站蜘蛛池模板: 亚洲人成色7777在线观看不卡| 免费福利在线播放| 嫩草影院免费观看| 亚洲自国产拍揄拍| 国产h视频在线观看免费| 亚洲小说图片视频| 国产福利在线观看免费第一福利| 亚洲AV无码乱码在线观看代蜜桃| 国产又大又粗又长免费视频| 亚洲视频网站在线观看| 1000部拍拍拍18勿入免费视频下载 | 两个人看的www免费高清| 国产成人免费福利网站| 久久久久久亚洲av无码蜜芽| 国产精品麻豆免费版| 疯狂做受xxxx高潮视频免费| 亚洲午夜无码AV毛片久久| 中文字幕免费在线看电影大全 | 无码国产精品一区二区免费式芒果 | 国产精品va无码免费麻豆| 久久无码av亚洲精品色午夜| 男女交性永久免费视频播放| 深夜福利在线免费观看| 亚洲午夜爱爱香蕉片| 久久免费线看线看| 亚洲AV无码精品蜜桃| 免费真实播放国产乱子伦| 无套内射无矿码免费看黄| 亚洲人成亚洲人成在线观看| 日本在线看片免费人成视频1000| 亚洲第一成年网站大全亚洲| 日本高清色本免费现在观看| 成在人线av无码免费高潮水| 亚洲欧洲日产国产最新| 在线观看特色大片免费视频| 久久亚洲精品成人无码| 国产AV无码专区亚洲AV男同 | 性做久久久久免费看| 中文字幕在线免费视频| 亚洲精品在线电影| 国产乱子影视频上线免费观看|