首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SQL中查寻某几项完全一样的数据

2012-11-08 
SQL中查找某几项完全一样的数据有以下一个表movestar(id,name,title,address),内容为:现在要查找所有具有

SQL中查找某几项完全一样的数据

有以下一个表

movestar(id,name,title,address),内容为:

SQL中查寻某几项完全一样的数据

现在要查找所有具有相同的title和address的人

 select star1.name,star2.name,star1.title,star1.address from movestar as s

tar1,movestar as star2 where star1.title = star2.title and star1.address = star2

.address and star1.name < star2.name;

结果:

SQL中查寻某几项完全一样的数据

要点:使用了<,假如用<>则会将内容重复列出

热点排行