asp.net – How do I reference a row from one in my second query – Education Career Blog

I have two queries

Dim query1 as String = "Select * from openquery (devbook, 'SELECT start_date FROM bookings WHERE investor = ''00000'' ')"

Dim FlightQuery as String = "Select * from openquery (devbook, 'SELECT price FROM flight_prices WHERE dep_date = start_date ')"

Where it says dep_date = start_date I need to grab the start_date from the first query and put it into my 2nd query.

These aren’t my full queries they are more complicated and confusing than these but I put these as examples.

Any ideas?

Thanks

Jamie

,

I think What you are looking is IN/Subquery

Select * from openquery where start_date in (select start_date from investor where....)

Leave a Comment