Quantcast
Channel: Latest Questions on Splunk Answers
Viewing all articles
Browse latest Browse all 13053

dbquery correlated subquery

$
0
0

I am trying to query two databases in the following manner: select from the first database using a static query to get a list of values. Next, select from another database using the list of values returned from the first query as input to the IN-clause of the second query. Unfortunately I cannot figure out how to write the query so that the IN-clause is populated dynamically. Is this even possible? If so, would someone please provide me with an example?

Example:
On DB 1: select id from sometable where type = 1 On DB 2: select id from sometable where type = 1 and id not in ( )

Thank You,

Patrick


Viewing all articles
Browse latest Browse all 13053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>