SQL中查找某几个字段完全一样的数据
发布日期:2021-12-19 02:53 | 文章来源:脚本之家
有以下一个表
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;
from movestar as star1,movestar as star2
where star1.title = star2.title
and star1.address = star2.address
and star1.name < star2.name;
结果:
要点:使用了<,假如用<>则会将内容重复列出
以上就是SQL中查找某几个字段完全一样的数据的全部内容,希望能给大家一个参考,也希望大家多多支持本站。
版权声明:本站文章来源标注为YINGSOO的内容版权均为本站所有,欢迎引用、转载,请保持原文完整并注明来源及原文链接。禁止复制或仿造本网站,禁止在非www.yingsoo.com所属的服务器上建立镜像,否则将依法追究法律责任。本站部分内容来源于网友推荐、互联网收集整理而来,仅供学习参考,不代表本站立场,如有内容涉嫌侵权,请联系alex-e#qq.com处理。
相关文章