Try this hierarchical query.

onewayticket (onewayticket)
Why not try the following SQL query.

SELECT LPAD(\" \", 2*(LEVEL-1))||column1, column2, ...
FROM table_name
WHERE column1 like \"A%\"
START WITH column1 = \"A\"
CONNECT BY prior column1 = substr(column1, 1, length(column1) - 1);

Result like:

column1 column2 ...
------------ ------------
A
AA
AAA
AAB
AB


The \"LEVEL\", \"START WITH\", \"prior\" and \"CONNECT BY\" are the Oracle key words

Note: LPAD(\" \"), \"A%\", \"A\" , the \" should be replaced by DAN1 YIN3 HAO4.
(#217993@0)
2001-10-6 -05:00

回到话题: Can Table be Inheretence? details in contents.

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=217993