0

我想做的是我将 id 传递给 SP 然后我的查询得到 uder Id's Against it 我的查询如下所示,

select RequestFrom from UserReqest where RequestTo=10 and IsApprove=0

select * from user where user_ID= (i have to use all five id's here ?)

当我将“10”传递给 sp 时,它将得到五个不同的 id 与 id“10”,那么我将如何获取所有这 5 个 id 的数据?我将如何实施它?我必须使用循环?我需要建议...

提前致谢

4

1 回答 1

0

您可以使用以下查询:

select * from user where user_ID in
(
    select RequestFrom from UserReqest where RequestTo=10 and IsApprove=0
)
于 2013-01-04T22:01:13.103 回答