<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 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評(píng)論 :: 0 Trackbacks
    打印五環(huán)和五角星的SQL代碼
    ?
    ?
    ??? 大牛寫的這兩段SQL實(shí)在是太銷魂了,實(shí)在是忍不住要轉(zhuǎn)載過(guò)來(lái),留著以后慢慢看,太牛了……
    ??? 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 閱讀(411) 評(píng)論(0)  編輯  收藏 所屬分類: 05.SQL
    主站蜘蛛池模板: 青青青国产免费一夜七次郎| 亚洲日产2021三区在线| 永久免费av无码网站大全| 久操视频在线免费观看| 日韩免费在线中文字幕| 亚洲国产精品成人午夜在线观看 | 久久精品亚洲一区二区三区浴池 | ww在线观视频免费观看w| 亚洲无码一区二区三区| 亚洲高清免费在线观看| 国产亚洲精品一品区99热| 亚洲人成无码www久久久| 国产不卡免费视频| 四虎成人精品一区二区免费网站| 曰批视频免费40分钟试看天天| 色www永久免费网站| 亚欧乱色国产精品免费视频| 亚洲国产综合AV在线观看| 国产99在线|亚洲| 亚洲一区在线视频观看| 亚洲大香人伊一本线| 亚洲色大成网站www永久| 久久亚洲精品国产精品黑人| 亚洲AV无码乱码国产麻豆| 国产亚洲综合久久系列| 国产亚洲成av人片在线观看 | 久久国产美女免费观看精品| 免费大片黄在线观看| 阿v免费在线观看| 窝窝影视午夜看片免费| 免费一级做a爰片久久毛片潮| 国产成人综合亚洲| jizz中国免费| 91在线免费视频| 国产精品免费福利久久| 亚洲一区免费观看| 91精品免费在线观看| 大学生一级毛片免费看| 成人免费777777| 四虎永久精品免费观看| 亚洲黄黄黄网站在线观看|