[Quote]
我使用了你这个方法不行哦?呵。
SQL语句是:
SELECT t1.stu_id,t1.stu_name,t3.co_id#,t2.co_name
FROM t1
INNER JOIN
t3 ON t3.stu_id = t1.stu_id
WHERE
t3.co_id = 1 AND t3.co_id = 5[/Quote]
你的观察力还需要煅练,或者说你应该更认真的去看别人的回复。
[Quote]
select c.*
from 表2 a inner join 表2 b on a.pid=b.pid
inner join 表1 c on a.pid=c.pid
where a.attr1='方法1' and b.attr1='方法2'[/Quote]
SELECT t1.stu_id,t1.stu_name,t3.co_id#,t2.co_name
FROM t1
INNER JOIN
t3 ON t3.stu_id = t1.stu_id
WHERE
t3.co_id = 1 AND t3.co_id = 5
t1表
stu_id stu_name
1 aa
2 bb
3 cc
t3表
stu_id co_id
1 1
1 4
2 1
2 3
2 5
我使用了你这个方法不行哦?呵。 SQL语句是:
SELECT t1.stu_id,t1.stu_name,t3.co_id#,t2.co_name
FROM t1
INNER JOIN
t3 ON t3.stu_id = t1.stu_id
WHERE
t3.co_id = 1 AND t3.co_id = 5