Skip to content
Advertisement

SQL change subquery to join

I have the following query, which has a subquery. I need the subquery converted to a join with a separated-out “where” clause for the dates, which will be parametised in an excel spreasheet.

The subquery obtains a count of all the merchant’s transactions between given dates. I’ve tried everything I can think of but I either get too many rows or some other thing is wrong.

There are two tables involved:

Advertisement

Answer

This should work :

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