2012-09-19 67 views
0

我在我的數據庫表2:尋找一個子查詢,

  • TableA包含aIdaBIda3,...
  • TableB包含bIdb2valueb3,...

aBIdtableB a的bId

我需要一個MySQL查詢,從表A,其中從出價記錄有b2value = '東西' ...... 恨查詢選擇所有記錄...

+0

[INNER JOIN](http://www.mysqltutorial.org/mysql-inner-join .aspx)提到答案進來3 ... 2 ... – raina77ow

+0

@ raina77ow ... 1去(抱歉) –

回答

4
select a.* 
from TableA a 
inner join TableB b on a.aBid = b.bId 
where b.b2Value = 'something' 
+0

謝謝,作品完全是我想要的方式 – dumazy

0

選擇。* FROM表A上a.aBId = b.bId聯接表b b其中 b.b2value = '東西'

0
select * 
    from TableA 
    inner join TableB on TableA.aBId = TableB.bId 
    where TableB.b2Value = 'something'