Oracle table is determined whether the value in another table, and generates a new virtual column

select ps.*,case
when psi.id in ps.pid
then 'true'
else 'false'
end resCol
from Table1 ps left join Table2 psi
on ps.id=psi.pid

Guess you like

Origin www.cnblogs.com/messi1314/p/11847846.html