Skip to content

Instantly share code, notes, and snippets.

@oreales
Forked from oscar-reales-interactiv4/quote-cleaning.sql
Created February 12, 2014 23:06
Show Gist options
  • Save oreales/8966378 to your computer and use it in GitHub Desktop.
Save oreales/8966378 to your computer and use it in GitHub Desktop.
#PARA CUSTOMERS borrando QUOTES más antiguas de 45 días
#DELETE FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000;
SELECT * FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000;
#PARA NO CUSTOMERS borrando QUOTES más antiguas de 30 días.
#DELETE FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY);
SELECT * FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY) LIMIT 50000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment