sql 过滤重复数据
发布日期:2021-06-29 17:05:06
浏览次数:3
分类:技术文章
本文共 360 字,大约阅读时间需要 1 分钟。
表
id name
1 苹果
2 梨 3 香蕉 4 香蕉 5 梨
正常查询
select * from Table_1
结果
id name
1 苹果
2 梨 3 香蕉 4 香蕉 5 梨
过滤重复1
select * from Table_1 a where not exists (select * from Table_1 where a.name=name and a.id
id name
1 苹果
4 香蕉 5 梨
重点:a.id<id
过滤重复2
select * from Table_1 a where not exists (select * from Table_1 where a.name=name and a.id>id)
id name
1 苹果
2 梨 3 香蕉
重点:a.id>id
转载地址:https://cplvfx.blog.csdn.net/article/details/103366753 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月19日 01时13分00秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
win7 64位下redis的安装
2019-04-30
winform中读写SQLite数据库例子
2019-04-30
ECharts上手例子
2019-04-30
SQLite 查询时异常:该字符串未被识别为有效的 DateTime 错误
2019-04-30
c# Socket发送与接收方法
2019-04-30
C#实现快捷键(系统热键)响应
2019-04-30
Windows下nginx+tomcat实现简单的负载均衡
2019-04-30
winform中SQLite的分页
2019-04-30
C# WinForm窗体及其控件自适应各种屏幕分辨率
2019-04-30
winform中dataGridView的简单分页
2019-04-30
dataGridView几个小技巧
2019-04-30
RecyclerView Item 行高定义无效的BUG
2019-04-30
markdown发生HTML渲染组件出错的解决方案
2019-04-30
android ScrollView嵌套WebView高度为0的BUG
2019-04-30
android 混淆代码后 app 运行报错时, 如何精准定位报错位置
2019-04-30
android 定位并通过百度在线查询详细地址教程
2019-04-30
android TextView 首行缩进与部分文字改变颜色大小效果
2019-04-30
android app 优化启动体验, 不闪白屏并且快速展示 splash
2019-04-30
INSTALL_FAILED_NO_MATCHING_ABIS 解决方案
2019-04-30
android 把打好的 apk 包通过 adb 的方式安装到手机上
2019-04-30