源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

SQL中查找某几个字段完全一样的数据

  • 时间:2022-05-04 13:55 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:SQL中查找某几个字段完全一样的数据
有以下一个表 [b]movestar(id,name,title,address),内容为:[/b] [img]http://files.jb51.net/file_images/article/201606/201606081037581.jpg[/img] 现在要查找所有具有相同的title和address的人
[u]复制代码[/u] 代码如下:
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;
[b]结果:[/b] [img]http://files.jb51.net/file_images/article/201606/201606081037592.jpg[/img] 要点:使用了<,假如用<>则会将内容重复列出 以上就是SQL中查找某几个字段完全一样的数据的全部内容,希望能给大家一个参考,也希望大家多多支持编程素材网。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部