Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.1
-
Fix Version/s: 1.5.0
-
Component/s: Zend_Db_Select
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
We can currently do this:
$select = $db->select()
->from('table1')
->join('table2', 'table1.column1 = table2.column1');
But we'd like to do it more conveniently like this:
$select = $db->select()
->from('table1')
->joinUsing('table2', 'column1');
So that the resulting SQL statement uses the USING syntax.
The two queries should produce the same result, assuming that your join condition in the first example is an equality between two columns that have the same name in both tables.
Note that USING is followed by a list of columns, comma-separated, inside parentheses.
Bill, how had you imagined the join type being specified? If the method signature is to follow the existing patterns of joinInner, joinFull, etc... then the join type might need to be supplied as a 4th parameter which may not be optimal.