我有3个不同的表格结构,我会称它们为A,B,C。Mysql从3个表格中选择
我需要做在同一时间所有的3个表进行搜索,让我需要对:
A.name LIKE%谷歌%B.company LIKE%谷歌%和C.company LIKE% Google%
对于提到的“查询类型”有一个查询可能吗?
最好的问候!
这里是我要找的
Select from table A where A.name LIKE %something% inner join B on b.company LIKE %something% and after that I need to do the samething for table C..but I don't know how...
查询:
SELECT name FROM firmen WHERE name LIKE '%Felsengartenkellerei Besigheim eG%'
UNION
SELECT firma FROM daten WHERE firma LIKE '%Felsengartenkellerei Besigheim eG%'
UNION
SELECT firma FROM ver WHERE firma LIKE '%Felsengartenkellerei Besigheim eG%'
你可以详细介绍一下你想做什么吗?这三张表是以某种方式相关的?模式结构将会非常有用。 – 2009-12-08 02:18:41
这3个表是否相互独立?只是为了详细说明dlo的提示......在这两个表中是否有任何外键关系? – 2009-12-08 02:21:08
不,完全不同的表格结构...我需要对它们进行搜索...并且如果我找到了它正在寻找的用户,我需要显示它!以下是需要搜索的字段名称: 对于表A - >名称对于表B - >公司对于表C - >公司 – Uffo 2009-12-08 02:24:40