2
I have a table of products that bring information from an XML, and another table in the system that basically receives these products after approval (we have an interface to define what enters or not, basically changing a value in the product so that it is not visible but remains at the base). Products that enter XML often bring several similar items, change only a few parameters in the product SKU, due to difference in size of clothes, as the example:
What I’d like to do is this:
How can I select all duplicate results, except one of them, and update the imported column of these that select bring. The imported as 0 hides the product from the approval queue, so the queue will not show several times the same product that basically only has the different SKU.
Thank you guys.
tried to use the <pre>UPDATE sis_prodo_xml query WHERE sku NOT IN (SELECT MAX(id) AS lastid, name FROM sis_producto_xml WHERE name IN ( SELECT name FROM sis_producto_xml GROUP BY name HAVING COUNT(*) > 1 ) GROUP BY name) SET imported = 1;</pre> but failed.
– thierry rene matos