Last active
December 19, 2015 08:49
-
-
Save ErDmKo/5928723 to your computer and use it in GitHub Desktop.
move my db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into orders_useradr | |
select | |
NULL as id, | |
p.user_id as user_id, | |
p.city as adr | |
from | |
orders_userprofile as p; | |
update | |
orders_userprofile, | |
orders_useradr | |
set | |
orders_userprofile.adr_id = orders_useradr.id | |
WHERE | |
orders_useradr.user_id=orders_userprofile.user_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(*) from ( | |
SELECT count(`orders_order`.id) as no FROM `orders_order` | |
left join orders_orderurl | |
on orders_order.id = orders_orderurl.order_id | |
GROUP BY `orders_order`.id HAVING count(orders_orderurl.url) > 1 | |
) as t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE from customprofile_userbalancehistory as history | |
LEFT JOIN customprofile_paylog as log | |
ON history.user_id = log.user_id | |
SET history.ts = log.created | |
WHERE date(ts) < '2013-01-10' AND info like '%0%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment