sql - update statement with limit -


update accounts left join users b on     a.user_id = b.user_id set `sold` = '1' b.country = 'ua' , a.site = 'od' 

how limit query?

tried

update accounts left join users b on     a.user_id = b.user_id set `sold` = '1' b.country = 'ua' , a.site = 'od' limit 500 

but error error : incorrect usage of update , limit

try this

update accounts left join users b on a.user_id = b.user_id set 'sold' = '1' b.country in (select country (select country users country = 'ua' order user_id asc limit 500) tmp) ,  a.site in (select site (select site accounts site = 'od' order user_id asc limit 500) tmp2); 

see further details on select limit statement.

http://www.techonthenet.com/sql/select_limit.php


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -