您现在的位置是:网站首页> 编程资料编程资料
SQL中查找某几个字段完全一样的数据_MsSql_
2023-05-26
317人已围观
简介 SQL中查找某几个字段完全一样的数据_MsSql_
有以下一个表
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中查找某几个字段完全一样的数据的全部内容,希望能给大家一个参考,也希望大家多多支持。
您可能感兴趣的文章:
相关内容
- SQL语句实现表中字段的组合累加排序_MsSql_
- T-sql语句修改SQL Server数据库逻辑名、数据库名、物理名的方法_MsSql_
- SQL Server时间戳功能与用法详解_MsSql_
- sqlserver中几种典型的等待_MsSql_
- 拯救你的数据 通过日志恢复MSSQL数据_MsSql_
- Win10下安装Sql Server 2014反复提示需安装.NET Framework 3.5 SP1的解决方案_MsSql_
- SQL 双亲节点查找所有子节点的实现方法_MsSql_
- 快速实现SQL Server数据库恢复备份_MsSql_
- SQL server服务显示远程过程调用失败的解决方法_MsSql_
- 我也有微信朋友圈了 Android实现_MsSql_
