0

我的数据库中有 2 个表:

  • TableA包含aId, aBId, a3, ...
  • TableB包含bId, b2value, b3,...

aBIdbIdtableB

我需要一个 mysql 查询,它从 tableA 中选择所有记录,其中来自 bId 的记录具有 b2value = 'something'...讨厌查询...

4

3 回答 3

4
select a.* 
from TableA a
inner join TableB b on a.aBid = b.bId
where b.b2Value = 'something'
于 2012-09-19T15:30:24.170 回答
0

select a.* from TableA a join TableB b on a.aBId = b.bId where b.b2value = 'something'

于 2012-09-19T15:30:42.293 回答
0
    select * 
    from TableA
    inner join TableB on TableA.aBId = TableB.bId
    where TableB.b2Value = 'something'
于 2012-09-19T15:32:22.373 回答