4.0.18-standard-log

I have a very basic one to many relationship, accounts and transactions.

There is only one account per users, but of course, there can be x
transactions.  These are once a month charges for billing.

I need to be able to select all accounts where next_charge_date <= NOW()
That's the easy part, I get all the records I want.  However, some of those
get charges through one gateway, and some get charged through another.

The transaction table has a field called merchant, lets say it can be bankA
or bankB.

So, I need a list of accounts, where none of its "many" transaction records
has the merchant bankA.

I also need to do the same for bankB

This allows me to then run each chunk of records through the correct gateway
processor.

Of course, this join will result in x records where x = the number of
transaction records, so I just group by the account id to get only one
record back.

I can script this, it is going to be slow, I would like to see how I can do
it in SQL.

thanks

-- 
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
<http://www.newgeo.com>                     Novato, CA U.S.A.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to