I want use a query like such
SELECT personId
FROM Person p
Inner Join address a on p.personId=a.personId
WHERE(a.created > GETDATE() -10)
I want to then use this data to filter this query
SELECT *
FROM accounts a
WHERE a.person /*is in the results of the previous query */
How can I do this?
This should do the trick (assuming you have the column personId in your account table).
Alternatively, rather than using a subquery you could just join the 3 tables directly: