我对具有 3 个表的 SQL Server 2008 数据库有疑问TradeAllocations
:TradeTickets
和Contracts
.
我想要 ALL Trade Allocations
for ALLContracts
具有即时日期 > 今天在Trade Tickets
. 我尝试的任何子查询和连接都没有数据,或者只有未来的提示日期。
任何帮助将不胜感激!
谢谢
SELECT
TA.ContractID_Ref, C.Contract_Num, TT.PromptDate
FROM
TradeAllocations as TA
JOIN
Contracts as C ON C.ContractID = TA.ContractID_Ref
JOIN
TradeTickets as TT ON TT.TradeTicketID = TA.TradeTicketID_Ref