2010-10-20 63 views
2

引用一行從一個我有兩個疑問如何我在第二個查詢

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 ')" 

凡說dep_date = start_date我要抓住第一個查詢的start_date,並把它放到我的第二個查詢。

這些不是我的完整查詢,他們比這些更復雜和混亂,但我把這些作爲例子。

任何想法?

感謝

傑米

回答

1

我想你要找的IN/Subquery

Select * from openquery where start_date in (select start_date from investor where....) 
相關問題