I’m looking for a way to join two result rows together.
I’ve got two tables:
settings table:
id | pop_setting1_id | pop_setting2_id
user table:
user_id | setting_id
pop_setting1_id and pop_setting2_id in first table points to setting_id in second table
I would like to have a query that takes one parameter (id) and gives one row result like:
user_id as user_id_1 | user_id as user_id_2 | setting_id as setting_id1 | setting_id as setting_id2
made from two rows from user table, where setting_id matches pop_setting1_id or pop_setting2_id respectively.
Setting_id in user table is unique, so it’s for sure that it will be only two results. All I want is to rename those results and squeeze them in one row. Give me some hints please.
Try this::