Re: [SQL ] 有辦法這樣下嘛
※ 引述《dream1x (翻桌客 )》之銘言:
: 我有兩個資料表A和B分
: ┌──────────────┐
: 表A │user│tourid│..............│
: └──────────────┘
: ┌──────────────────┐
: 表B │tourid│ x │ y │ z │.............│
: └──────────────────┘
: sql要怎麼下才可以找到 表B 然後符合
: A.user='admin'and B.tourid = A.tourid 這個條件的
: select * ....... 我怎麼下都不對
: 先感謝囉
try this
select a.user , a.tourid from table_a a, table_b b where a.user='admin' and
a.tourid=b.tourid;
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.166.194.151
※ 編輯: iamnotfat 來自: 118.166.194.151 (08/11 22:12)
※ 編輯: iamnotfat 來自: 118.166.194.151 (08/11 22:12)
→
08/11 22:13, , 1F
08/11 22:13, 1F
推
08/11 23:34, , 2F
08/11 23:34, 2F
推
08/12 20:20, , 3F
08/12 20:20, 3F