case statement options splitted on two output columns
问题 I have a table with a list of functionalities for my site. Say it has three columns: id_usr - url - landing_page 1 a.php a.html 2 b.php b.html 3 c.php c.html 4 d.php d.html Then I have a table where for each user i have those functionalities he can display: id_usr - func 1 1 1 3 This query (from this question of mine) SELECT f.id, CASE WHEN id_user IS NOT NULL THEN url ELSE landing_page END FROM funzioni f LEFT JOIN funz_abilitate fa ON fa.id_funzione = f.id AND fa.id_user = $id is returning