Skip to content
Advertisement

How to use a result from a SQL select to get records in another table?

I’m having a hard time with creating a Sql that pull data from three tables.

Here are part of the structure of each table:

The result I need is all the customer that is on routeno 1, 2 and 3 then I need any invoices that have the delivery date (deldate) and the expdate of any that have a credit card on file. Sorted by delno.

From this result I need the following.

I tried using Join, but then I only get the customer that have invoices I nned them all.

I need a result like this:

Thanks for any help. KHJ

Advertisement

Answer

The link provided should point you the right direction. Another way approach this is to create an outer joined subquery with the desired filter criteria on invoice.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement