php - Compare results of two queries laravel - Stack Overflow

preview_player
Показать описание
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

Рекомендации по теме
visit shbcf.ru