A
A
Alexander Bondarenko2020-02-11 13:56:56
css
Alexander Bondarenko, 2020-02-11 13:56:56

Duplicate record in a query with LEFT JOIN, how to fix it?

Upon request

SELECT CONCAT(maintb.name, ', ', country1.country, ', ', region.region,', ', house.house) 
AS ADDRESS FROM maintb
  LEFT JOIN country1
   ON country1.id = {0}
     LEFT JOIN region
      ON region.id ={1}
        LEFT JOIN house
         ON house.id ={2}

The output of records occurs 6 times instead of once, how can I fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2020-02-11
Tag

SQL SELECT DISTINCT Statements

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question