Written by Zhong Wei
- 服务器端配置公众平台 appId, appSecret
- 缓存针对此appId的 accessToken 和 jsapi_ticket
You want to add a unique index to a table, and unfortunately, there are already many duplicate rows in it. Manually find and delete these rows is time-wasting and error-prone. So why won't we just write one SQL statement and quickly resolve it?
First try, I wrote the following statement, and it won't work:
DELETE FROM PromotionSkus A WHERE A.SkuId IN (SELECT SkuId FROM PromotionSkus B GROUP BY B.SkuId HAVING COUNT(B.SkuId) > 1) AND A.Id NOT IN (SELECT MIN(Id) FROM PromotionSkus C GROUP BY C.SkuId HAVING COUNT(C.SkuId) > 1);
AND this one below works!
DELETE FROM PromotionSkus A WHERE A.Id NOT IN (SELECT Id FROM (SELECT MIN(Id) AS Id, COUNT(SkuId) AS Total FROM PromotionSkus GROUP BY SkuId HAVING Total > 1) AS B) AND A.SkuId IN (SELECT SkuId FROM (SELECT SkuId FROM PromotionSkus GROUP BY SkuId HAVING COUNT(SkuId) > 1) AS C);
The reason is well explained in this brilliant article.
The most important thing is that you only need to correctly add the cookies, then the cookies will be automatically sent to the API server. Don't try to add a cookie item at the headers' configuration part!
vim 命令模式粘贴寄存器中复制好的内容：先Ctrl+R，再输入寄存器名字。默认寄存器名字是 "
.bashrc别 echo 东西，否则 Jenkins 会拒绝干活。（应该弄一台专门的机器只跑 Jenkins）