check if record exists in join table


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT id,name FROM products WHERE EXISTS ( SELECT version_id FROM versionships WHERE products.id = versionships.version_id );

Report this snippet


Comments


You need to login to view comments.