jeudi 19 mai 2016

Mysql random number or row to my query

I try to insert random number to populate my specials, but not succesfull I have query

INSERT INTO oc_product_special (product_id, customer_group_id, priority, price, date_start, date_end) SELECT product_id, '1', '0', price*0.80, '0000-00-00', '2016-05-20' FROM `oc_product` WHERE product_id IN ( SELECT product_id FROM oc_product )

and in the end

SELECT product_id FROM oc_product

I want to get random row from oc_product or random product_id, and limit to this query insert set to 1000




Aucun commentaire:

Enregistrer un commentaire