left join sql select with where clause or on conditional
Wednesday, April 6th, 2011Given a database schema containing the following tables: CREATE TABLE `categories` ( `id` int(10) unsigned NOT NULL auto_increment, `category` varchar(31) NOT NULL default ”, PRIMARY KEY (`id`) ) ENGINE=InnoDB; CREATE TABLE `account_categories` ( `acct_id` int(10) unsigned NOT NULL, `cat_id` int(10) unsigned NOT NULL, `markup` decimal(3,2) NOT NULL default ’0.00′, PRIMARY KEY (`acct_id`,`cat_id`), KEY `cat_id` (`cat_id`), [...]


