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

怎样找出 姓名相同,会员编号不同的顾客?解决方法

2012-04-17 
怎样找出 姓名相同,会员编号不同的顾客?姓名 name会员编号 cli_no[解决办法]SQL codeselect *from tb twhe

怎样找出 姓名相同,会员编号不同的顾客?
姓名 name
会员编号 cli_no

[解决办法]

SQL code
select *from tb twhere exists (select 1 from tb where name = t.name and id <> t.id)order by name
[解决办法]
SQL code
select * from tb t where exists (select 1 from tb where name=t.name and cli_no<>t.cli_no)
[解决办法]
探讨

SQL code

select *
from tb t
where exists (select 1 from tb where name = t.name and id <> t.id)
order by name

[解决办法]

 select * from tab1 a
where exists (select 1 from tab1 where name=a.name and cli_no<>a.cli_no)

热点排行