Artificial intelligent assistant

SQL データが存在する場合にのみFlagを立てる Flag SQL master_table as master productID,name 45473xc, nintendo 33333xc, sony ads_table as ads productID, adsID 45473xc, 32311 adsID with ads as ( select productID, case when adsID >= 1 then 1 else 0 ends as ads_flag from ads_table ) select master.productID, master.name, ads.ads_flag from master_table as master left join ads on ads.productID = master.productID where master.productID in ( 45473xc, 33333xc ) 45473xc33333xc master.productID, master.name, ads.ads_flag 45473xc, nintendo, 1 master.productID, master.name, ads.ads_flag 45473xc, nintendo, 1 33333xc, sony, 0




SELECT master_table.productID,
master_table.name,
CASE WHEN ads_table.adsID IS NULL THEN 0 ELSE 1 END AS ads_flag
FROM master_table
LEFT JOIN ads_table
ON master_table.productID = ads_table.productID

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 055bad44c0a1dda03015c822ca3d9aba