Answer the question
In order to leave comments, you need to log in
Yii2 documentation discrepancy?
Good afternoon.
The official Yii2 documentation says:
leftJoin() public method
Appends a LEFT OUTER JOIN part to the query.
$query = new \yii\db\Query();
$query->select('data.field AS field, fields.name AS name, data.value AS value, fields.public AS public')
->from (['profile_fields'.' fields'])
->leftJoin('profile_field_data'. ' data','fields.field = data.field')
->where(['fields.role' => array_keys($roles), 'user_id' => $userID]);
SELECT `data`.`field` AS `field`, `fields`.`name` AS `name`, `data`.`value` AS `value`, `fields`.`public` AS `public` FROM `profile_fields` `fields` <b>LEFT JOIN</b> `profile_field_data` `data` ON fields.field = data.field WHERE (`fields`.`role` IN ('InternalLawer', 'Superuser')) AND (`user_id`=1)
Answer the question
In order to leave comments, you need to log in
LEFT JOIN is the same as LEFT OUTER JOIN .
You can see in the JOIN documentation that OUTER is in square brackets. This means that this keyword is optional, and the default JOIN will be OUTER .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question