« 700 spam a month | Main | Oracle exception handling »

July 20, 2005

Oracle "connect by" "start with"

Oracle's connect by and start with is one very powerful feature that I've just discovered recently. This feature is really useful when you have parent - child relationship in a table, for example this type of layout:

id | parent_id | val
=============
1 | null | 5
2 | 1 | 6
3 | 1 | 7

I also found another good trick that although many of the samples on the Net don't show it, start with clause can be supplied with multiple parameter, making it possible to start with a sub-selected ids.

Posted by vhadiant at July 20, 2005 10:13 PM





Trackback Pings

TrackBack URL for this entry:
http://www.hadianto.net/mov32/mt-tb.cgi/70

Comments

Post a comment





Remember Me?

(you may use HTML tags for style)