Fabio Intermoia Posted May 14, 2018 Share Posted May 14, 2018 Salve ragazzi è possibile realizzare una query che estragga la lista dei prodotti senza immagine? Grazie del supporto Link to comment Share on other sites More sharing options...
Codencode Posted May 14, 2018 Share Posted May 14, 2018 Ci sono 2 modi: 1) con LEFT JOIN SELECT p.id_product FROM ps_product p LEFT JOIN ps_image i on i.id_product = p.id_product WHERE i.id_product IS NULL 2) con una subquery SELECT id_product FROM ps_product WHERE id_product NOT IN (SELECT id_product FROM ps_image); Con grandi moli di dati il secondo metodo è più performante. Link to comment Share on other sites More sharing options...
Fabio Intermoia Posted May 15, 2018 Author Share Posted May 15, 2018 Grazie Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now