--1.
select * from your_table a
where (select count(1) from your_table where Province = a.Province and Pname = a.Pname)>1
order by address
select * from your_table a
where (select count(1) from your_table where Province = a.Province and Pname = a.Pname)>1
order by address
解决方案 »
- 服务器端表格发生变动后立即通知客户端,应该怎么实现?
- Windows Server 2008 R2只支持64位的CPU,下面的这篇文章是不是骗人的
- 如何在新建记录的同时计算累计值?
- 请问:文本文件怎样导入到sql server 指定的字段里?
- SQL语句问题
- 求SQL语句
- ms-sql server与oracle数据库比较
- 如何将远程数据备份到FTP里(是广域网,不是局域网内备份)
- 还是上次那个表转成视图的问题(附图)
- 再请教:alter tabletable name add colomn fieldname int defaut 0行不通
- 运行代码,出现如下错误提示,为什么?
- 哪位帮我解释一下这个存储过程的详细意思,
select top 200 *
from your_table a
where exists(select 1 from your_table where Pname = a.Pname and tel = a.tel and PID <> a.PID)
order by PID
declare my_cursor for select * from your_table where Province = '广东' and city = '广州'
open my_cursor
fetch next from my_cursor
while(@@fetchstatus = 0)
begin
print '100'
end
close my_cursor
deallocate my_cursor
select * from your_table where Pname not in(seielt not distance(Pname ) where your_table) and Province='北京'[/ code]大概是这样写的 没在SQL中实验
where (select count(1) from tb where Pname = a.Pname)>1 and Province='北京'
order by address
2、select top 200 * from tb a where (seleect count(1) from tb where a.Pname=Pname and a.Tel=Tel)>1
3、declare cursor my_cursor for select * from tb where Province = '广东' and city = '广州'
open my_cursor
fetch next from my_cursor
while(@@fetchstatus = 0)
begin
......
end
close my_cursor
deallocate my_cursor
--1.
select * from t a where province='北京'
and exists(select * from t where province='北京' and pid<>a.pid and pname=a.pname)
order by [address]
--2.
select top 200 * from t a where
exists(select * from t where pname=a.pname and tel=a.tel and pid<>a.pid)
--3.
d
declare t_cur cursor for select * from t where province='广东' and city='广州'
open t_cur
fetch next from t_cur
while @@fetch_status=0
begin
fetch next from t_cur
end