【发布时间】:2010-12-25 10:20:17
【问题描述】:
我有两张桌子,
Table1:
id, int1, int2, int3
john,1,2,4
tim,2,3,4
pete,1,3,4
Table2:
integer,blob
1,wins
2,backtickle
3,text
4,whatever
给定我要使用的查询的 id 我想从 table2 中获取与 table1 中的每个整数列相关联的 blob 数据。
我可以在这里使用的具体查询是什么?
我正在寻找的示例结果类似于:
搜索 John 返回“wins”、“backtickle”、“whatever”
搜索皮特返回 "wins","text","whatever"
我认为这与外键有关,但不确定...请初学者级别!对于 1 个表,它将是 SELECT * FROM table1 WHERE id="........" 但不确定我现在上面给出的设置。
【问题讨论】: