select * from friend a
where exists(select 1 from friend b
where a.u_id=b.friend_id and a.friend_id=b.U_id)
解决方案 »
- 求一条sql语句08年和09年工资汇总
- 选取两个表里的部分字段组成一个表
- 高手啊,来帮帮我嘛~~
- 太慢了! 再慢的脾气也会急死! Sqlserver 新增表分区 的 非常之疑难问题!!!
- [分享]怎么捕获和记录SQL Server中发生的死锁?
- sqlserver拒绝网络访问???
- 谁能帮我修改下!
- 各位大侠:为什么WIN2000 professional装不上sql server?
- 在数据库技术中面向对象数据模型是一种(),请高人求求我,Help me!!!
- 用VC编客户端程序,数据库服务器为SQLServer2000,用哪种技术更好呢?
- 求援:最难的一种数据转换要求了,网上找了半天也未找到答案。。。
- 数据库一致性错误
insert into friend select 1,3
insert into friend select 2,3
insert into friend select 3,2select U_id,friend_id as 好友 from friend a
where exists(select 1 from friend b
where a.u_id=b.friend_id and a.friend_id=b.U_id)
and U_id=3select U_id,friend_id as 审核好友 from friend a
where not exists(select 1 from friend b
where a.u_id=b.friend_id and a.friend_id=b.U_id)
and friend_id=3
from ta a
where not exists(select 1 from ta where Friend_ID = a.Friend_ID and U_ID = a.U_ID)
and U_ID = 3