1

我有 3 个表名 REGISTERMASTER、FRIEND 和 UPLOAD。

我想获取 UPLOADwhere UPLOAD.id= session["id"]或其朋友 ID 的所有列,并REGISTERMASTER拥有所有 ID 的详细信息,所以我想获取这些 UPLOAD.id 的详细信息。

我写了这个查询

select * from upload left join registermaster on upload.id=registermaster.id where upload.id in ('"+Session["id"]+"', select userid from friend where frienid='"+Session["id"]+"' and approve='"+true+"') 

但是有子查询返回多个值的错误

请帮忙

4

1 回答 1

0

利用select top 1 userid from friend where frienid='"+Session["id"]+"' and approve='"+true+"')

于 2013-07-26T18:39:20.400 回答