例如A条记录的id为1,otherID为2
B记录的id为2,otherID为1,
怎么同时将这2条记录查询出来,就这2个字段的数据的关联的
我也不会,帮你顶一下吧
B记录的id为2,otherID为1,
怎么同时将这2条记录查询出来,就这2个字段的数据的关联的
我也不会,帮你顶一下吧
解决方案 »
- 如何判断是否点中bitmap(触控点落在bitmap的绘制区域)?图片可旋转情况下
- Android当中软键盘的问题
- 求助 向 DHCP 请求IP的过程
- android notification
- Android WebView问题
- 安卓 如何实现类似于网页<frame/>标签的功能
- 请教:关于onTouchEvent的压感参数
- 有谁知道Android中Email程序提供的Provider有哪些?
- R.id.widget29_getName_EditText是什么东东
- 安卓开发APP
- 请问各位在编写代码的时候出现xxx cannot to be resloved要怎么破?
- 为什么手机中照片修改或删除后,还能在手机数据相册中看到原来的内容?
select id,otherID from(select *,groups=(case when t1.id<t1.otherID then rtrim(t1.id)+','+rtrim(t1.otherID) else
rtrim(t1.otherID)+','+rtrim(t1.id) end) from tb t1 where exists(select 1 from tb t2 where t1.id=t2.otherID and t1.otherID=t2.id)
)t order by groups
select id,otherID from(select *,groups=(case when t1.id<t1.otherID then rtrim(t1.id)+','+rtrim(t1.otherID) else
rtrim(t1.otherID)+','+rtrim(t1.id) end) from tb t1 where exists(select 1 from tb t2 where t1.id=t2.otherID and t1.otherID=t2.id)
)t order by groups这个groups提示没这一行
select * from tb t1 where t1.id<t1.otherID and exists(select 1 from tb t2 where t1.id=t2.otherID and t1.otherID=t2.id)
查出来的都是id<otherid的那一条,然后java代码中循环遍历的时候add两条就可以
add(id,otherid)
add(otherid,id)
select * from tb t1 where t1.id<t1.otherID and exists(select 1 from tb t2 where t1.id=t2.otherID and t1.otherID=t2.id)
查出来的都是id<otherid的那一条,然后java代码中循环遍历的时候add两条就可以
add(id,otherid)
add(otherid,id)
恩,好的,谢谢了哈