开发者

How do I reference a row from one in my second query

开发者 https://www.devze.com 2023-01-20 19:07 出处:网络
I have two queries Dim query1 as String = \"Select * from openquery (devbook, \'SELECT start_date FROM bookings WHERE investor = \'\'00000\'\' \')\"

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 qu开发者_运维技巧ery 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....)
0

精彩评论

暂无评论...
验证码 换一张
取 消