Created
December 1, 2011 03:41
-
-
Save mikedfunk/1413346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT `bt_accounts`.`id`, `bt_payments`.`id`, `bt_payments`.`amount`, `bt_payments`.`date`, `bt_users`.`first_name`, `bt_users`.`last_name` | |
FROM (`bt_accounts`) | |
LEFT JOIN `bt_payments` ON `bt_payments`.`account_id` = `bt_accounts`.`id` | |
LEFT JOIN `bt_salespeople` ON `bt_salespeople`.`id` = `bt_accounts`.`salesperson_id` | |
LEFT JOIN `bt_users` ON `bt_users`.`salesperson_id` = `bt_salespeople`.`id` | |
ORDER BY `bt_payments`.`id` desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment