Skip to content
Advertisement

Find all other records for an ID if a record exists

I need to find all other related records for an ID if a certain value exists.

I have almost no SQL experience and work primarily on a front end design UI, rather than writing the code myself.

The basic query is:

For a given period, if any customer placed an order in that period, I’d like to see all orders for those customers.

So looking for all orders for any customer who placed an order in April:

Expected result would be:

Any help provided would be greatly appreciated.

Advertisement

Answer

I would write it literally like your described it: Find all the customers from April and then show all the orders for those customers.

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