There are 2 tables:
field -id -title field_val -id -field_id -user_id The task: to make a selection of all fields of the field table with a connected table field_val , the type of connection OUTER .
But to set the external table field_val additional condition field_val.user_id = x . And, if the field with the condition field_val.user_id = x does not exist, then output NULL , keeping the field from the first table.
The problem is that if there is no user_id field with a value of Х in the field_val table, then the field of the field table is also not displayed.
I will not give an example of what I did, but it does not work, because I make up a request for AR in YII.1