Join Of Two Table And Get The Distinct Records With Three Fields

Join of two table and get the distinct records with three fields.

I want to retrieved all the fields from two tables using join and apply distinct clause on three fields.

eg.

I have table User which has fields id,name,lastname,dob

and another table education_info id, id_user(which is reference of user table),school_name,addresss.

I have to retrieved the fields name,lastname,dob,school_name,address in which following fields are distinct name,lastname and shool_name.

Help appreciated :)

Hey try this…




select 

(SELECT group_concat(DISTINCT a) FROM my_table) as a,

(SELECT group_concat(DISTINCT <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='B)' /> FROM my_table) as b,

(SELECT group_concat(DISTINCT c) FROM my_table) as c,

(SELECT group_concat(DISTINCT d) FROM my_table) as d



thanks for the nice sharing