用于在多个表中搜索字符串的MySQL SELECT命令用法?

I have to make a search across two tables and display results from 3 tables.

Table: Clients ( tblclients )

  • id
  • firstname
  • lastname

Table: Ticket Details ( tbltickets)

  • id
  • details
  • clientid <-> The data is from tblclients.id

Table: Ticket Replies ( tblreplies)

  • id
  • ticketid <-> This data is from tbltickets.id
  • details

Ok, What I want to do is to search for a string across the tables ( tbltickets and tblreplies ) on the field details and I want to get the output of the result as the the follows

result must contains the following rows

  • firstname
  • lastname
  • clientid
  • id <-> From tbltickets.id

I tried multiple select queries. However, I am not getting the exact result that I wanted

SELECT firstname, lastname, clientid, tbltickets.id as id 
from tblclients, tbltickets, tblreplies 
WHERE tblclients.id=tbltickets.clientid 
AND tbltickets.id=tblreplies.ticketid 
AND 
(
 tbltickets.details like '%SEARCH_STRING%'
 OR 
 tblreplies.details like '%SEARCH_STRING%'
);