I have the following tables :
test1=# select * from radius_users;
id | name | password | pass_gen
----+--------+----------+------------------------
6 | user 5 | MD5 | 2002-01-16 15:37:19+00
4 | user 6 | MD5 | 2002-01-16 15:08:53+00
1 | user 1 | MD5 | 2002-01-16 15:36:47+00
test1=# select * from radius_sections;
id | name
----+---------------
2 | section Alpha
3 | section_beta
4 | section_omega
test1=# select * from radius_user_config ;
user_id | section_id | value
---------+------------+-----------
6 | 4 | value_1
6 | 3 | value_2
The value I have and need to base the entire query on is the USER_ID
(or ID in radius_users). I need to return all the values in
radius_user_config that apply to the USER_ID specified but I also need
to know which sections are null and what their names are.
If I am not making sense here this is the result table I am after :
id | name | name | value
----+--------+----------------+-----------
6 | user 5 | section_alpha | value_1
6 | user 5 | section_beta | value_2
6 | user 5 | section_omega |
id = radius_users.id
first name = radius_users.name
second name = radius_sections.name
value = radius_user_confif.value
Thanks in advance