Examples:
$q->join('address'); // on user.address_id=address.id
$q->join('address.user_id'); // on address.user_id=user.id
$q->join('address a'); // With alias
$q->join(array('a'=>'address')); // Also alias
Second argument may specify the field of the master table
$q->join('address', 'billing_id');
$q->join('address.code', 'code');
$q->join('address.code', 'user.code');
Third argument may specify which kind of join to use.
$q->join('address', null, 'left');
$q->join('address.code', 'user.code', 'inner');
Using array syntax you can join multiple tables too
$q->join(array('a'=>'address', 'p'=>'portfolio'));
You can use expression for more complex joins
$q->join('address',
$q->orExpr()
->where('user.billing_id=address.id')
->where('user.technical_id=address.id')
)