SQL中查找某几个字段完全一样的数据
作者:meaijojo 时间:2024-01-26 12:55:59
有以下一个表
movestar(id,name,title,address),内容为:
现在要查找所有具有相同的title和address的人
select star1.name,star2.name,star1.title,star1.address
from movestar as star1,movestar as star2
where star1.title = star2.title
and star1.address = star2.address
and star1.name < star2.name;
结果:
要点:使用了<,假如用<>则会将内容重复列出
标签:SQL,查找
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
PyQt5实现画布小程序
2022-03-02 07:37:46
![](https://img.aspxhome.com/file/2023/1/99331_0s.jpg)
vue.js中ref及$refs的使用方法解析
2024-05-09 10:42:35
![](https://img.aspxhome.com/file/2023/7/126627_0s.png)
python3 re返回形式总结
2023-12-23 16:40:07
使用Python将Mysql的查询数据导出到文件的方法
2024-01-17 21:36:22
ASP日期格式化函数
2010-08-08 19:18:00
python datetime时间格式的相互转换问题
2023-12-22 01:04:29
![](https://img.aspxhome.com/file/2023/7/93677_0s.jpg)
Python+OpenCV之图像轮廓详解
2023-08-10 18:59:42
![](https://img.aspxhome.com/file/2023/1/62001_0s.png)
python读取hdfs并返回dataframe教程
2022-03-22 17:15:33
django如何自己创建一个中间件
2021-03-31 10:26:59
![](https://img.aspxhome.com/file/2023/5/71345_0s.png)
关于搜索建议的两点小问题
2011-09-16 20:15:29
用javascript来实现仿gogle动画导航
2007-11-30 14:15:00
![](https://img.aspxhome.com/file/UploadPic/200711/30/20071130141752445s.gif)
用Python展示动态规则法用以解决重叠子问题的示例
2023-02-09 02:20:36
![](https://img.aspxhome.com/file/2023/2/101322_0s.png)
如何使用Vue3设计实现一个Model组件浅析
2024-04-27 15:57:19
springboot配置文件抽离 git管理统 配置中心详解
2021-05-24 08:17:18
禁止背景图在网页中平铺
2011-04-29 14:10:00
![](https://img.aspxhome.com/file/UploadPic/20072/2007231139890s.gif)
pip和pygal的安装实例教程 <font color=red>原创</font>
2021-05-22 18:35:30
![](https://img.aspxhome.com/file/2023/9/97589_0s.png)
Python WSGI 规范简介
2022-02-06 23:30:06
![](https://img.aspxhome.com/file/2023/2/92222_0s.png)
Python lambda表达式filter、map、reduce函数用法解析
2022-03-30 03:52:31
Doctype之谜
2009-07-22 20:48:00
微信小程序wxml列表渲染原理解析
2023-07-17 14:28:08