filmov
tv
php - Compare results of two queries laravel - Stack Overflow

Показать описание
select id,
case when id in (select distinct id from selected_cat) then 'Yes'
else 'No' end
as somecol
from cat;
You can use a case statement to check for the existence of id in the other table.
#existence #'yes' #select #case #statement
case when id in (select distinct id from selected_cat) then 'Yes'
else 'No' end
as somecol
from cat;
You can use a case statement to check for the existence of id in the other table.
#existence #'yes' #select #case #statement