This code shows how to delete duplicate rows on pgsql DELETE FROM m_product WHERE sku in( SELECT sku FROM ( SELECT sku, count(*) FROM m_product GROUP BY sku HAVING count(*) > 1 ) a ) AND em_mg_manufacturer = 1000012 In MYSQL DELETE product FROM product WHERE reference in ( SELECT reference FROM ( […]
UPDATE m_product SET em_mg_longdescription = regexp_replace(em_mg_longdescription,’————‘,chr(13)) WHERE em_mg_manufacturer = 1000637 AND value = ‘IMI-YW356A01′ Some additional replace scripts UPDATE m_product SET em_mg_longdescription = regexp_replace(em_mg_longdescription,'</li>’,chr(10)) WHERE em_mg_manufacturer = 1000637 UPDATE m_product SET em_mg_longdescription = replace(em_mg_longdescription,'<li>’,”) WHERE em_mg_manufacturer = 1000637 UPDATE m_product SET em_mg_longdescription = replace(em_mg_longdescription,'<ul>’,”) WHERE em_mg_manufacturer = 1000637 UPDATE […]
I installed PHPMyadmin to check my help manage my database, eventhough I also use the desktop program MySQL Workbench, I fell sometimes its important to use the webconsole. Recently, upon checking my MySQL Logs (/var/logs/mysql/error.log) I encountered that everyday I had thousands of failed logins to the PHPMyAdmin. I sure enough have a very strong […]
It’s stupidly complicated to get just one record per group on a PostgreSQL query… After an hour of trial and error this worked for me: SELECT DISTINCT ON (c_order_id) c_order_id FROM c_invoice No Group By or Limit 1 functions needed.
SQL error: ERROR: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view rv_warehouseprice depends on column “sku” In statement: ALTER TABLE “adempiere”.”m_product” ALTER COLUMN “sku” TYPE character varying(50) I’ve read some documentation and the only apparent solution is to delete all the related views and then […]