Jump to content

Артикул комбинации из Артикула


Recommended Posts

Здравствуйте. Недавно были изменены все артикулы на сайте из вида 01-0000 в вид 0000. Заметил что Артикулы комбинаций остались старыми. 

Подскажите пожалуйста, каким запросом sql можно взять артикул из комбинаций и заменить его обычным артикулом (нужно учитывать что не во всех товарах есть артикул комбинации).

INSERT INTO `ps_product_attribute` (`id_product_attribute`, `id_product`, `reference`, `supplier_reference`, `location`, `ean13`, `upc`, `wholesale_price`, `price`, `ecotax`, `quantity`, `weight`, `unit_price_impact`, `default_on`, `minimal_quantity`, `available_date`) VALUES
(35560, 105, '01-188', '', '', '', '', '0.000000', '1950.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(35559, 105, '01-188', '', '', '', '', '0.000000', '2000.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(34947, 106, '01-189', '', '', '', '', '0.000000', '1680.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(34946, 106, '01-189', '', '', '', '', '0.000000', '1720.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(34945, 106, '01-189', '', '', '', '', '0.000000', '1760.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31373, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '5990.350000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31374, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '6675.750000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31375, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '8817.050000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31386, 171, '01-320', NULL, NULL, NULL, NULL, '0.000000', '7701.550000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31385, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '5347.500000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31384, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '13259.500000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31383, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '11786.350000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31382, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '10519.050000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31381, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '9104.550000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31380, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '6894.250000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31379, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '6188.150000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31378, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '12847.800000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(31377, 170, '01-319', NULL, NULL, NULL, NULL, '0.000000', '11532.200000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(35332, 109, '01-192', '', '', '', '', '0.000000', '1700.000000', '0.000000', 0, '0.000000', '0.00', 1, 1, '0000-00-00'),
(35331, 109, '01-192', '', '', '', '', '0.000000', '1700.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12881, 263, '01-257', '', '', '', '', '0.000000', '1931.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12880, 263, '01-257', '', '', '', '', '0.000000', '1502.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12879, 263, '01-257', '', '', '', '', '0.000000', '901.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12878, 263, '01-257', '', '', '', '', '0.000000', '1444.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12877, 263, '01-257', '', '', '', '', '0.000000', '823.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12876, 263, '01-257', '', '', '', '', '0.000000', '729.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12875, 263, '01-257', '', '', '', '', '0.000000', '494.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12874, 263, '01-257', '', '', '', '', '0.000000', '215.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12873, 263, '01-257', '', '', '', '', '0.000000', '122.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(12860, 264, '01-259', '', '', '', '', '0.000000', '0.000000', '0.000000', 0, '0.000000', '0.00', 1, 1, '0000-00-00'),
(27782, 1196, NULL, NULL, NULL, NULL, NULL, '0.000000', '2353.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27781, 1196, NULL, NULL, NULL, NULL, NULL, '0.000000', '2205.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27780, 1196, NULL, NULL, NULL, NULL, NULL, '0.000000', '2063.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27779, 1196, NULL, NULL, NULL, NULL, NULL, '0.000000', '1773.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27778, 1196, NULL, NULL, NULL, NULL, NULL, '0.000000', '1350.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27766, 98, NULL, NULL, NULL, NULL, NULL, '0.000000', '1895.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27765, 98, NULL, NULL, NULL, NULL, NULL, '0.000000', '1776.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27763, 98, NULL, NULL, NULL, NULL, NULL, '0.000000', '1181.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
(27764, 98, NULL, NULL, NULL, NULL, NULL, '0.000000', '1537.000000', '0.000000', 0, '0.000000', '0.00', 0, 1, '0000-00-00'),
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...