两张表A,B
A和B的CODE字段是对应的,想求出
A.CODE=B.CODE
A.ID=某个值
B.TYPE=某个值
A.TYPE=某个值
的结果 应该怎么写?
select * from A a,B b
where a.id = (#)
and a.code=b.code
and a.type = (#)
and b.type = (#)
A和B的CODE字段是对应的,想求出
A.CODE=B.CODE
A.ID=某个值
B.TYPE=某个值
A.TYPE=某个值
的结果 应该怎么写?
select * from A a,B b
where a.id = (#)
and a.code=b.code
and a.type = (#)
and b.type = (#)
select * from A a inner join B b
on a.code=b.code
where a.id = (#) and a.type = (#) and b.type = (#)
from A join b on a.code=b.code
where a.id = (#)
and a.type = (#)
and b.type = (#)
..改下顺序
on a.code=b.code
where a.id = '(#)' and a.type = '(#)' and b.type = '(#)'
from A join b on a.code=b.code
where a.id = (#)
and (a.type = (#)
or b.type = (#))
where a.code=b.code
and a.id = (#)
and a.type = (#)
and b.type = (#)?
-- 我再猜
select * from A a inner join B b
on a.code=b.code
where a.id = '#' and a.type = '#' and b.type = '#'