| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> zai Oracle zhong xuan qu you fu zi huo shu zhuang guan xi de shu ju ji lu
 

zai Oracle zhong xuan qu you fu zi huo shu zhuang guan xi de shu ju ji lu

2008-07-29 06:19:14 编辑來源:互联网 评论
 
本文为【在Oracle中选取有父子或树状关系的数据记录】的拼音翻译版
  fu zi guan xi xing ji lu ji huo zhe shu zhuang guan xi shu ju ji lu ji shi wo men zai ruan jian kai fa zhong yi zhong jiao wei chang jian de shu ju zu zhi xing shi 。 li ru ban gong xi tong zhong de zu zhi jia gou , li ru yong hu xi tong zhong de sheng fen cheng shi qu yu , li ru dian zi shang wu wang zhan zhong de chan pin fen lei , li ru liu yan ban xi tong zhong de liu yan hui fu guan xi , zhu ru ci lei 。
  dui yu zhe yi lei xing de shu ju wo men chang chang hui shi yong zhu cong biao huo zhe zhu cong zi duan de fang fa lai man zu jie gou shang de xu qiu 。
  suo wei zhu cong biao jiu shi jiang ge ji shu ju fen bie cun fang zai bu tong de shu ju biao zhong ( li ru da lei cun fang zai yi ge shu ju biao , xiao lei cun fang zai ling yi ge shu ju biao ; you ru sheng fen cun fang yi ge shu ju biao , cheng shi cun fang zai ling yi ge shu ju biao ), dan shi zhe yang you yi ge wen ti , jiu shi shu ju you duo shao ceng jiu bi xu jian li duo shao ge shu ju biao , zhe yang bu li yu shu ju jie gou ceng ci de kuo zhan , bi ru dian zi shang wu wang zhan zhong de chan pin , chu qi gui hua zhi you da lei he xiao lei , sui zhe chan pin de zeng jia que fa xian jin you da lei he xiao lei yi jing wu fa man zu chan pin de fen lei xu qiu , zhe shi hou hui xu yao tian jia yi ge zhong lei de gai nian , wei le man zu zhe ge bian hua wo men jiu xu yao xin zeng yi ge zhong lei de shu ju biao , zhe yang hui zao cheng jiao da de bian geng , suo yi wo men shuo zhe zhong fen biao cun fang ge ji shu ju de she ji you yi ding de ju xian xing 。 er ru guo shi yong ling wai de yi ge jie jue ban fa - zhu cong zi duan - ze neng gou jiao hao de jie jue zhe ge wen ti , ye jiu shi shuo wo men ba sheng fen he cheng shi , chan pin de da lei yu xiao lei , zhe xie wu li jie gou xiang tong 、 luo ji jie gou bu tong de shu ju cun fang zai tong yi ge shu ju biao zhong , yi ID he ParentID liang ge zi duan lai biao ming ge tiao shu ju zhi jian de luo ji guan xi 。
  wo men zai peng dao zhe zhong shu ju jie gou de shi hou wang wang xi wang tong guo yi ci shu ju cao zuo xuan qu yi mou yi tiao shu ju wei qie ru dian de quan bu xiang guan shu ju 。 li ru fang wen yi tiao ke shi de xin xi shi , xi wang tong shi cheng xian gai ke shi suo zai de chu 、 bu men xin xi , you li ru huo qu yi tiao BBS liu yan de shi hou , xu yao jiang qi quan bu de hui fu yi ji ge ge hui fu de hui fu dou yi ci xuan chu , zhe dou shi zui chang jian de xu qiu 。 xia mian wo men jiu jie shao ru he zai Oralce zhong shi yong yi tiao SQL yu ju cong yi ge qie ru dian huo qu gai qie ru dian de quan bu xiang guan xin xi 。 xia mian wo men jiang mo ni yi ge BBS de liu yan yu hui fu shu ju lai shuo ming zhe ge SQL yu ju
  jia she wo men xian zai you ru xia jie gou de shu ju (T_Topic)
  TopicID ParentID TopicTitle
  1 null qing jiao Oracle xuan qu shu zhuang shu ju
  2 1 re: qing jiao Oracle xuan qu shu zhuang shu ju
  3 1 qi shi zhi yao zhe yang jiu ke yi
  4 1 wo ye you tong yang de wen ti , xue xi
  5 1 ding !
  6 5 bu yao fa la ji tie o ~
  7 3 xue xi ing
  8 3 bu shi Oracle de fang fa ya
  9 6 wo xi huan ding , za di
  10 9 feng hao !
  da jia zhu yi kan , shang mian de zhe xie ji lu qi shi dou shi TopicID=1 de ji lu de xiang guan ji lu ( zi ji lu huo zhe sun ji lu , zong gui shi hou dai ji lu )
  wo men xian zai xu yao shi yong yi tiao yu ju xuan ze yi TopicID wei 1 ji lu de quan bu hou dai ji lu , qing kan xia mian de SQL:
  SELECT TopicID,ParentID,TopicTitle FROM T_TOPIC CONNECT BY PRIOR TopicID = ParentID START WITH TopciID = 1
  tong guo zhe tiao SQL, wo men jiu ke yi yi ci cong Table zhong xuan qu TopiID=1 de ji lu de quan bu hou dai ji lu ji qi zi shen 。 zhe tiao yu ju de guan jian bu fen jiu shi CONNECT BY PRIOR... START WITH, zhe ju hua de biao zhun yu fa ru xia
  SELECT FROM TABLENAME CONNECT BY {PRIOR lie ming 1 = lie ming 2 | lie ming 1 = PRIOR lie ming 2 } [START WITH];
  CONNECT BY guan jian zi yong yu she ding guan lian de liang ge zi duan ,PRIOR guan jian zi yong yu she ding you xian shen zhao zi duan ,START WITH guan jian zi yong yu she ding qie ru dian 。 kan dao zhe san ge guan jian zi de shuo ming , da jia yi ding hui xiang dao yi ge wen ti , ji ran ke yi dui bu tong de zi duan jin xing you xian shen zhao , na ji ran ke yi tong guo gen jie dian xuan chu qi quan bu de zi jie dian , na me ye ying gai ke yi tong guo zi jie dian lai xuan qu qi quan bu de zu xian jie dian le , yin wei PRIOR de you xian she ding jiu shi zai she ding qi sou suo de fang xiang 。 ru guo PRIOR she ding wei zi jie dian you xian , ze hui xuan qu ben jie dian de quan bu hou dai jie dian , fan zhi ru guo PRIOR she ding wei fu jie dian you xian , jiu ke yi ni xiang de dao quan bu de zu xian jie dian le , huan shi yi shang mian de shu ju wei li , wo men cong “ feng hao ” zhe tiao ji lu zuo wei qie ru dian , shi yong ru xia de SQL
  SELECT TopicID,ParentID,TopicTitle FROM T_TOPIC CONNECT BY TopicID = PRIOR ParentID START WITH TopicID = 10
  wo men jiu neng yi ci xing xuan chu ru xia de shu ju ji lu , ye jiu shi cong “ feng hao ” zhe tiao ji lu kai shi de quan bu zu xian jie dian
  TopicID ParentID TopicTitle
  10 9 feng hao !
  9 6 wo xi huan ding , za di
  6 5 bu yao fa la ji tie o ~
  5 1 ding !
  1 null qing jiao Oracle xuan qu shu zhuang shu ju
  yi shang wo men jiu jiang jie le ru he tong guo yi ge qie ru dian zhao dao mou yi ge jie dian de quan bu hou dai jie dian huo zhe quan bu zu xian jie dian , ye xu nin hui shuo le , wo bing bu xu yao xuan qu quan bu , wo zhi yao xuan liang ceng , wo de shu zhi yuan xu xian shi liang ceng 。 en , mei cuo , zhe ye hui shi chang jian de xu qiu zhi yi , bu guo bu yao jin , wo men ke yi tong guo jia ru yi ge xin de guan jian zi Level , shi yong zhe ge guan jian zi , wo men jiu ke yi kong zhi bei xuan chu de guan xi ceng 。 ju ti de yong fa , wo men huan shi yi di er ge SQL xu qiu zuo wei li zi , xian zai jia she shi xu yao cong “ feng hao ” zhe tiao shu ju xiang shang zhao liang ceng zu xian jie dian chu lai , gai ru he cao zuo ne ? rang wo men lai kan SQL
  SELECT Topic,ParentID,TopicTitle FROM T_TOPIC WHERE LEVEL <= 3 CONNECT BY TopicID = PRIOR ParentID START WITH TopicID = 10
  da jia yi ding zhu yi dao le zhe tiao SQL zhong duo le zhe yang yi duan zi ju LELVEL <= 3 , zhe ge jiu shi yong lai xian ding xuan qu ceng ji de zi ju , zhe tiao zi ju jiu que bao le wo men ke yi xuan qu bao kuo jie dian yi ji qi xiang shang liang ceng zu xian jie dian yi gong san ceng jie dian 。LEVEL zhe ge zi ju de bian hua ye rang ni de dao yi xie geng jia bian tai [-_-!] de jie guo , li ru wo zhi yao qu dang qian jie dian de zu fu jie dian , na zhi yao jiang Level she ding wei Level = 3, qu diao yi ge xiao yu hao jiu neng man zu yi ge bian tai de xu qiu le LEVEL chu le ke yi she ding wei pu tong de da yu 、 xiao yu 、 deng yu 、 da yu deng yu 、 xiao yu deng yu zhi wai , shen zhi huan ke yi she ding wei BETWEEN X AND Y, shi zai shi yi ge hen bu cuo de guan jian zi , ke yi rang wo men man zu hen duo bian tai de xu qiu 。
  yi shang jiu shi guan yu CONNECTY BY ... PRIOR ... START WITH de ji ben shi yong fang fa 。 dang ran le , yong hu de xu qiu yong yuan shi BT de , bu guo wo xiang xin tong guo shang mian de zhe xie ji ben ying yong de zu he , yi ding ke yi man zu da jia de xu qiu 。【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
fu zi guan xi xing ji lu ji huo zhe shu zhuang guan xi shu ju ji lu ji shi wo men zai ruan jian kai fa zhong yi zhong jiao wei chang jian de shu ju zu zhi xing shi 。 li ru ban gong xi tong zhong de zu zhi jia gou , li ru yong hu xi tong zhong de sheng fen cheng shi qu yu , li ru dian zi shang wu wang zhan zhong de chan pin fen lei , li ru liu yan ban xi tong zhong de liu yan hui fu guan xi , zhu ru ci lei 。 dui yu zhe yi lei xing de shu ju wo men chang chang hui shi yong zhu cong biao huo zhe zhu cong zi duan de fang fa lai man zu jie gou shang de xu qiu 。 suo wei zhu cong biao jiu shi jiang ge ji shu ju fen bie cun fang zai bu tong de shu ju biao zhong ( li ru da lei cun fang zai yi ge shu ju biao , xiao lei cun fang zai ling yi ge shu ju biao ; you ru sheng fen cun fang yi ge shu ju biao , cheng shi cun fang zai ling yi ge shu ju biao ), dan shi zhe yang you yi ge wen ti , jiu shi shu ju you duo shao ceng jiu bi xu jian li duo shao ge shu ju biao , zhe yang bu li yu shu ju jie gou ceng ci de kuo zhan , bi ru dian zi shang wu wang zhan zhong de chan pin , chu qi gui hua zhi you da lei he xiao lei , sui zhe chan pin de zeng jia que fa xian jin you da lei he xiao lei yi jing wu fa man zu chan pin de fen lei xu qiu , zhe shi hou hui xu yao tian jia yi ge zhong lei de gai nian , wei le man zu zhe ge bian hua wo men jiu xu yao xin zeng yi ge zhong lei de shu ju biao , zhe yang hui zao cheng jiao da de bian geng , suo yi wo men shuo zhe zhong fen biao cun fang ge ji shu ju de she ji you yi ding de ju xian xing 。 er ru guo shi yong ling wai de yi ge jie jue ban fa - zhu cong zi duan - ze neng gou jiao hao de jie jue zhe ge wen ti , ye jiu shi shuo wo men ba sheng fen he cheng shi , chan pin de da lei yu xiao lei , zhe xie wu li jie gou xiang tong 、 luo ji jie gou bu tong de shu ju cun fang zai tong yi ge shu ju biao zhong , yi ID he ParentID liang ge zi duan lai biao ming ge tiao shu ju zhi jian de luo ji guan xi 。 wo men zai peng dao zhe zhong shu ju jie gou de shi hou wang wang xi wang tong guo yi ci shu ju cao zuo xuan qu yi mou yi tiao shu ju wei qie ru dian de quan bu xiang guan shu ju 。 li ru fang wen yi tiao ke shi de xin xi shi , xi wang tong shi cheng xian gai ke shi suo zai de chu 、 bu men xin xi , you li ru huo qu yi tiao BBS liu yan de shi hou , xu yao jiang qi quan bu de hui fu yi ji ge ge hui fu de hui fu dou yi ci xuan chu , zhe dou shi zui chang jian de xu qiu 。 xia mian wo men jiu jie shao ru he zai Oralce zhong shi yong yi tiao SQL yu ju cong yi ge qie ru dian huo qu gai qie ru dian de quan bu xiang guan xin xi 。 xia mian wo men jiang mo ni yi ge BBS de liu yan yu hui fu shu ju lai shuo ming zhe ge SQL yu ju jia she wo men xian zai you ru xia jie gou de shu ju (T_Topic) TopicID ParentID TopicTitle 1 null qing jiao Oracle xuan qu shu zhuang shu ju 2 1 re: qing jiao Oracle xuan qu shu zhuang shu ju 3 1 qi shi zhi yao zhe yang jiu ke yi 4 1 wo ye you tong yang de wen ti , xue xi 5 1 ding ! 6 5 bu yao fa la ji tie o ~ 7 3 xue xi ing 8 3 bu shi Oracle de fang fa ya 9 6 wo xi huan ding , za di 10 9 feng hao ! da jia zhu yi kan , shang mian de zhe xie ji lu qi shi dou shi TopicID=1 de ji lu de xiang guan ji lu ( zi ji lu huo zhe sun ji lu , zong gui shi hou dai ji lu ) wo men xian zai xu yao shi yong yi tiao yu ju xuan ze yi TopicID wei 1 ji lu de quan bu hou dai ji lu , qing kan xia mian de SQL: SELECT TopicID,ParentID,TopicTitle FROM T_TOPIC CONNECT BY PRIOR TopicID = ParentID START WITH TopciID = 1 tong guo zhe tiao SQL, wo men jiu ke yi yi ci cong Table zhong xuan qu TopiID=1 de ji lu de quan bu hou dai ji lu ji qi zi shen 。 zhe tiao yu ju de guan jian bu fen jiu shi CONNECT BY PRIOR... START WITH, zhe ju hua de biao zhun yu fa ru xia SELECT FROM TABLENAME CONNECT BY {PRIOR lie ming 1 = lie ming 2 | lie ming 1 = PRIOR lie ming 2 } [START WITH]; CONNECT BY guan jian zi yong yu she ding guan lian de liang ge zi duan ,PRIOR guan jian zi yong yu she ding you xian shen zhao zi duan ,START WITH guan jian zi yong yu she ding qie ru dian 。 kan dao zhe san ge guan jian zi de shuo ming , da jia yi ding hui xiang dao yi ge wen ti , ji ran ke yi dui bu tong de zi duan jin xing you xian shen zhao , na ji ran ke yi tong guo gen jie dian xuan chu qi quan bu de zi jie dian , na me ye ying gai ke yi tong guo zi jie dian lai xuan qu qi quan bu de zu xian jie dian le , yin wei PRIOR de you xian she ding jiu shi zai she ding qi sou suo de fang xiang 。 ru guo PRIOR she ding wei zi jie dian you xian , ze hui xuan qu ben jie dian de quan bu hou dai jie dian , fan zhi ru guo PRIOR she ding wei fu jie dian you xian , jiu ke yi ni xiang de dao quan bu de zu xian jie dian le , huan shi yi shang mian de shu ju wei li , wo men cong “ feng hao ” zhe tiao ji lu zuo wei qie ru dian , shi yong ru xia de SQL SELECT TopicID,ParentID,TopicTitle FROM T_TOPIC CONNECT BY TopicID = PRIOR ParentID START WITH TopicID = 10 wo men jiu neng yi ci xing xuan chu ru xia de shu ju ji lu , ye jiu shi cong “ feng hao ” zhe tiao ji lu kai shi de quan bu zu xian jie dian TopicID ParentID TopicTitle 10 9 feng hao ! 9 6 wo xi huan ding , za di 6 5 bu yao fa la ji tie o ~ 5 1 ding ! 1 null qing jiao Oracle xuan qu shu zhuang shu ju yi shang wo men jiu jiang jie le ru he tong guo yi ge qie ru dian zhao dao mou yi ge jie dian de quan bu hou dai jie dian huo zhe quan bu zu xian jie dian , ye xu nin hui shuo le , wo bing bu xu yao xuan qu quan bu , wo zhi yao xuan liang ceng , wo de shu zhi yuan xu xian shi liang ceng 。 en , mei cuo , zhe ye hui shi chang jian de xu qiu zhi yi , bu guo bu yao jin , wo men ke yi tong guo jia ru yi ge xin de guan jian zi Level , shi yong zhe ge guan jian zi , wo men jiu ke yi kong zhi bei xuan chu de guan xi ceng 。 ju ti de yong fa , wo men huan shi yi di er ge SQL xu qiu zuo wei li zi , xian zai jia she shi xu yao cong “ feng hao ” zhe tiao shu ju xiang shang zhao liang ceng zu xian jie dian chu lai , gai ru he cao zuo ne ? rang wo men lai kan SQL SELECT Topic,ParentID,TopicTitle FROM T_TOPIC WHERE LEVEL <= 3 CONNECT BY TopicID = PRIOR ParentID START WITH TopicID = 10 da jia yi ding zhu yi dao le zhe tiao SQL zhong duo le zhe yang yi duan zi ju LELVEL <= 3 , zhe ge jiu shi yong lai xian ding xuan qu ceng ji de zi ju , zhe tiao zi ju jiu que bao le wo men ke yi xuan qu bao kuo jie dian yi ji qi xiang shang liang ceng zu xian jie dian yi gong san ceng jie dian 。LEVEL zhe ge zi ju de bian hua ye rang ni de dao yi xie geng jia bian tai [-_-!] de jie guo , li ru wo zhi yao qu dang qian jie dian de zu fu jie dian , na zhi yao jiang Level she ding wei Level = 3, qu diao yi ge xiao yu hao jiu neng man zu yi ge bian tai de xu qiu le LEVEL chu le ke yi she ding wei pu tong de da yu 、 xiao yu 、 deng yu 、 da yu deng yu 、 xiao yu deng yu zhi wai , shen zhi huan ke yi she ding wei BETWEEN X AND Y, shi zai shi yi ge hen bu cuo de guan jian zi , ke yi rang wo men man zu hen duo bian tai de xu qiu 。 yi shang jiu shi guan yu CONNECTY BY ... PRIOR ... START WITH de ji ben shi yong fang fa 。 dang ran le , yong hu de xu qiu yong yuan shi BT de , bu guo wo xiang xin tong guo shang mian de zhe xie ji ben ying yong de zu he , yi ding ke yi man zu da jia de xu qiu 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
我们约会吧
漂亮白皙的模特
好纯好美的女生
靓丽的网络美女
痞子的甘南日记
疑是银河落九天
雪域坝上四——纯美色
冬日恋歌——西城杨柳弄轻柔
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有