通过group by和having去除重复
2024-08-23 15:54:51
$sql="SELECT peisonghao FROM ecs_order_info_ly GROUP BY peisonghao HAVING COUNT(*) >1";
$rlt=$GLOBALS['db']->query($sql);
while($data=$GLOBALS['db']->fetch_array($rlt)){
$rand=rand(10000,10000000);
$sql="update ecs_order_info_ly set order_sn='$rand' where order_id=".$data['order_id'];
$GLOBALS['db']->query($sql);
}
SELECT peisonghao FROM ecs_order_info_ly GROUP BY peisonghao HAVING COUNT(*) >1 把重复的行选出来
最新文章
- 使用 SoapUI 测试ASP.NET Web API
- C#读写文件的方法汇总_C#教程_脚本之家
- 字符串截取 方法 String b=a.substring(0, a.indexOf(";乘坐";));
- RabbitMQ 原文译1.1--HelloWord
- block 解析 - 局部变量
- 探索Scala(1)-- 运算符重载
- js extend的实现
- ajax+分页
- 安装shellinabox-master
- 推荐学习git
- Python数据分析Pandas库之熊猫(10分钟一)
- 100道Java基础面试题收集整理(附答案)
- defaultdict
- 【译】如何更好的使用javascript数组
- 张高兴的 .NET Core IoT 入门指南:(二)GPIO 的使用
- 记录一下gitlab通过CAS登录慢的问题
- spring boot配置使用fastjson
- noip模拟 五子棋
- Salesforce学习第一天
- arc073 F many moves(dp + 线段树)
热门文章
- 安装Pod时提示ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
- UE3植被工具-支持刷Actor)
- POJ 3694 tarjan 桥+lca
- speechSynthesis
- HDU1004 BALLO0N
- Introducing Windows 10 Editions(Windows10版本介绍)
- 实时刷新Winform中Label的Text
- codeforces 706D (字典树)
- ireport开发报表,Java和JSP端如何集成
- C++学习笔记16:Linux系统编程基础1