Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure exactly what you're trying to do, since we don't have the schema, but presumably A is a table of companies, where the 'name' field corresponds to a foreign-key 'company' field in both B and C, if that is so then you'd some thing like:</p> <pre><code>SELECT * FROM A, B, C WHERE A.name LIKE '%Google%' AND B.company = A.name AND C.company = A.name </code></pre> <p>Edit, so from your comment in the question where you say they're <em>not</em> foreign keys, you want to select all rows that have a particular filed 'LIKE' Google, you just do them one at a time:</p> <pre><code>SELECT * FROM A WHERE name LIKE '%Google%' SELECT * FROM B WHERE company LIKE '%Google%' SELECT * FROM B WHERE company LIKE '%Google%' </code></pre> <p>If all 3 of these tables had the same schema (or they have a few fields in common and you just select those in a corresponding order), you could take the UNION of these 3 queries if you wanted to join the results together.</p> <p>Suppose all 3 of them have a 'url' or 'webaddr' field, and they have 'desc', 'description', and 'info' fields respectively:</p> <pre><code>SELECT url, desc FROM A WHERE name LIKE '%Google%' UNION SELECT webaddr, description FROM B WHERE company LIKE '%Google%' UNION SELECT url, info FROM B WHERE company LIKE '%Google%' </code></pre> <p>There's a nice explanation of the semantics of UNION and UNION ALL in MySQL on <a href="http://www.tutorialspoint.com/mysql/mysql-union-keyword.htm" rel="nofollow noreferrer">tutorialspoint</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload