Mensajes: 2
Temas: 1
Registro en: Feb 2018
Reputación:
0
Buenos dias,
Uso Sysme TPV para una tienda de ropa. Y necesitaria conocer la sentencia SQL para poder borrar masivamente los productos de la temporada anterior que lo tengo filtrado usando el campo "Id adicional".
O sea, Borrar o sacar del listado de productos todos los productos que el "Id adicional" igual a "T2017".
Quedo a la espera de respuesta. Muchas gracias.
Mensajes: 15,328
Temas: 117
Registro en: Sep 2012
Reputación:
121
Hola kirch1, bienvenido/a al foro,
Borrar productos mediante script es delicado, la base de datos podría quedar inestable (según versión de Sysme Tpv) .. ¿de cuantos productos se trata y que versión estás usando?
Ya me dices.
Mensajes: 15,328
Temas: 117
Registro en: Sep 2012
Reputación:
121
Ok, haz una copia de seguridad antes de ejecutar el script:
delete from pack where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from pack where id_complementog1 in (select id_complementog from complementog where idinterno = "T2017");
delete from tipo_comg_comg where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from pnotacocina where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from pproveedor where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from productoimg where id in (select id_complementog from complementog where idinterno = "T2017");
delete from productoimgs where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from comg_tarifa where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from pack where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from combinados where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from combinados where id_complementog1 in (select id_complementog from complementog where idinterno = "T2017");
delete from variaciones where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from almacen_complementg where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from opencart_comg where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from alb_comg where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from inventario_complementg where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
delete from traspasos_complementog where id_complementog in (select id_complementog from complementog where idinterno = "T2017");
update complementog set cafeteria = "N" where id_complementog = "T2017";