I want to be able to use multiple keys to join two tables. Is the following possible?
SELECT * FROM items LEFT JOIN issues USING (item_id OR order_id)
This is a simplified version of what i am doing. using MySQL 5.1.36 in case that matters.
UPDATE: I want all the issues joined, using item_id or order_id. So there could be multiple issues per item. i vaguely remember something about group by but i never could figure out how to join multiple records to one.
would be nice to get something that looks like this:
array {
item_id => 1,
item_name => 'test item',
issues => array {
[0] => array { issue_id => 1, issue_type => 'test issue'},
[1] => array { issue_id => 2, issue_type => 'test issue'}
}
}
Hopefully that makes sense. basically, an array of the issues as part of the mysql result