select * from theTABLE start with parent_ID=0 connect by prior ID=parent_ID
解决方案 »
- 关于一个主表与多个从表的DETAIL_DATASTORE问题
- 取出表内所有数据并给出复合条件的具有相同ID的总
- 关于oracle的数据导入问题,百分求助
- 求一View…………
- 求sql文。。我真想不出解决方法了。。。急~~~
- oracle中任意函数的参数都可为NULL,这个是真的吗?
- 求一统计空字段的sql,请各位高手帮忙
- select 语句rownum 和order by 一起用时的奇怪问题?
- 一道有难度的查询问题.......
- 急:事务提交,居然后面的执行成功,前面的没有执行。
- Oracle 新手,求助各位前辈!
- 急需Oracle8i1.6 for Solaris SPARC版本,请问哪有此版本下载?哪位朋友有的话,能否共享?
---------- ---------- --------------------
0 0
1 2
2 3
3 0已用时间: 00: 00: 00.15
08:39:25 SQL> select id,parent_id,0 orderid from t1 where id=parent_id and paren
t_id=0 union
08:39:29 2 select id,parent_id,level orderid from (select * from t1 where id<
>parent_id) start with parent_id=0 connect by prior id=parent_id order by orderi
d; ID PARENT_ID ORDERID
---------- ---------- ----------
0 0 0
3 0 1
2 3 2
1 2 3已用时间: 00: 00: 00.00
start with id=0 connect by prior id=parent_id;
为什么我在SQL Scratchpad中,使用select ID, level order From table时显示错误:末找到预期的Form?
10:24:33 SQL> help select SELECT
------ Use this command to retrieve data from one or more tables, object
tables, views, object views, or snapshots. SELECT
[ DISTINCT | ALL ]
{ *
| { [ schema. ]{ table | view | snapshot } .*
| expr [ [ AS ] c_alias ] }
[, { [ schema. ]{ table | view | snapshot } .*
| expr [ [ AS ] c_alias ] } ] ...
FROM
{ [ schema. ]
{ table [ PARTITION ( partition_name ) | @dblink ]
| [ view | snapshot ] [ @dblink ] }
[ t_alias ]
| [ THE ] ( subquery )
[ t_alias ]
| TABLE ( nested_table_column )
[ t_alias ] }
[, { [ schema. ]
{ table [ PARTITION ( partition_name ) | @dblink ]
| [ view | snapshot ] [ @dblink ] }
[ t_alias ]
| [ THE ] ( subquery )
[ t_alias ]
| TABLE ( nested_table_column ) } ] ...
[ WHERE condition ]
[ [ START WITH condition ] CONNECT BY condition
| GROUP BY expr [, expr] ...
[ HAVING CONDITION ] ] ...
[ { UNION
| UNION ALL
| INTERSECT
| MINUS } SELECT command ]
[ ORDER BY { expr | position | c_alias } [ ASC | DESC ]
[, { expr | position | c_alias } [ ASC | DESC ] ] ...
| FOR UPDATE
[ OF [ [ schema. ]{ table. | view. } ] column
[, [ [schema.]{table. | view.} ] column] ...] [NOWAIT] For detailed information on this command, see the Oracle8 Server SQL
Reference.
Oracle9 Server SQL Reference的帮助文件从哪里可以得到?
oracle帮助里面就有
你用的这个语句执行的效率很低的,请问有什么方法改善吗?