0

I'm very rusty on my SQL, and I have to work on a query that looks something like the following:

select * from (
-- whole bunch of code here
where
-- more bits and pieces
connect by prior x = y
start with z = 'VALUE'

I want to run this query on a whole set of values, resulting from using another select statement. I'm looking for something with similar semantics to:

start with z in (select * from ...)

I'm using an Oracle SQL databse here. There are so many varieties of SQL I find it hard to get something useful from a search, I wouldn't have thought the solution is all that complicated (?). The final query does not have to be necessarily efficient, it will be run only once.

APC
  • 144,005
  • 19
  • 170
  • 281
jeeves90
  • 75
  • 6
  • 1
    why don't you use "start with z in (select x from ...)" ? – Multisync Nov 13 '14 at 08:13
  • I mean why are you trying to find something similar, if IN (subquery) should work fine with START WITH – Multisync Nov 13 '14 at 08:15
  • I agree, we can use a subquery to feed the START WITH clause – APC Nov 13 '14 at 08:17
  • Oh wow, I thought that was invalid syntax - I just made that syntax up. The syntax error I was getting yesterday was evidently unrelated. No mystery here after all. Doh. – jeeves90 Nov 13 '14 at 08:31
  • See the solution proposed by Tom Kyte : https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2755089600346724749 – Cyryl1972 Nov 14 '14 at 09:12

0 Answers0