应该是:
SELECT memID
FROM table3
WHERE memid in(select id
from table2
where id in (select id
from table1
where(id=@id)
)
)
在in表达式里不能使用slect * from ...,而是要明确指明字段。
CREATE PROCEDURE sel
(
@id int)
AS
BEGIN
SELECT
memID
FROM table3
WHERE memid in(select * from table2
where id in (select * from table1
where(id=@id)))
END
go