Sql query listing Fathers and childs with joins, how to distinct them?

Using a UNION and changing the LEFT JOIN to an INNER JOIN should give you the correct result SELECT table_n1. T1_name AS names FROM table_n1 UNION ALL SELECT CONCAT_WS(' / ', table_n1. T1_name, table_n2.

T2_name) AS names FROM table_n1 INNER JOIN table_n2 ON table_n2. T1_id = table_n1. T1_id.

Using a UNION and changing the LEFT JOIN to an INNER JOIN should give you the correct result. SELECT table_n1. T1_name AS names FROM table_n1 UNION ALL SELECT CONCAT_WS(' / ', table_n1.

T1_name, table_n2. T2_name) AS names FROM table_n1 INNER JOIN table_n2 ON table_n2. T1_id = table_n1.

T1_id.

Thanks, its perfect. – DaNieL Jun 8 '10 at 10:24.

This query return the 'father' (table_n1) name only when it doesn't have 'childs' (table_n2). How can I fix it?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions