Q:

Join Query to return a single row with Multiple table

The query is for search an user by city or area
user_table:
id user_name
1  user 1
2  user 2
3  user 3

second table is:
 user_id area_id
   1       1
   1       2
   1       3
   1       4
   3       1
   3       2
   3       3
   3       4

and the area table is: 
id area_name
 1  Area 1
 2  Area 2
 3  Area 3
 4  Area 4

It returns the record but I want to join the search with one more table as: 
id city_name
 1  Area 

select * 
  from user_table as ut 
         left join second_table as st on ut.id=st.user_id 
         left join area_table as at on st.area_id  = at.id 
 where like at.area_name=%Area% 

A:

Heum, if I understand well, you would like to get all users with informations about city and area where city name or area name match search.
Maybe you could try :
I suppose you pass two different values which MUST match (from search) : 
SELECT * 
  FROM user_table AS u 
  JOIN city_table AS c ON u.id = c.user_id AND c.city_name LIKE '%City%'
  JOIN area_table AS a ON c.area_id = a.id AND a.area_name LIKE '%Area%' 

It should return one line per user.

