-1

i trie to get results from two tables in my sql query. But all what i got, is the smaller table. So the LEFT JOIN gives me the results from the smaller table, which holds only 5 columns. The bigger one has about 25 columns. So if i trie to set the RIGHT JOIN, no results are shown. But also i got no error from mysql, just an empty result. Also the INNER JOIN dosen't work. Heres my query:

SELECT zu.*, peps.*
  FROM audit.zusammen zu
  RIGHT JOIN  audit.pep peps
    ON zu._id_fk = peps.id
  WHERE MATCH (zu.concat_Names) AGAINST ('merkel' IN BOOLEAN MODE)
  ORDER BY zu.last_Name
ben88
  • 57
  • 1
  • 8

1 Answers1

0

I assume that you mean row when you say column.

Also assuming that the big table is peps, I think that you want:

SELECT zu.*, peps.* 
FROM audit.pep peps 
LEFT JOIN audit.zusammen zu 
    ON zu.id_fk = peps.id  
    AND MATCH (zu.concat_Names) AGAINST ('merkel' IN BOOLEAN MODE) 
ORDER BY zu.last_Name

This will produce as many record as there are in peps, with optional data coming from zusammen for records that match on id_fk and whose concat_Names satifsfy the full text seach on 'merkel'.

Recommended reading: What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN?

GMB
  • 216,147
  • 25
  • 84
  • 135