Respected SIR/MADAM
I have 3 Tables like t1 which contains 3 field (Id,Name,registrationdate) and second t2(Id,Complaints,complaindate) and third t3(Id,Disease,diseasedate). I am register a id like 1 and i have inserted 2 complaints and 2 diseases . now i want to retrieve the data of complaints and diseases. i have tried like this
select distinct a.id,b.id,c.id,b.complaints,c.Disease,a.registrationdate,b.complaindate,c.diseasedate from t1 a left join t2 b on a.id = b.id left join t3 c on a.id = c.id and b.id= c.id ;
but it shows 4 records
like
1, 1, 1, Complaint1, Dengue,2014-06-23
1, 1, 1, Complaint2, Dengue,2014-06-23
1, 1, 1, Complaint1, fever,2014-06-23
1, 1, 1, Complaint2, fever,2014-06-23
but i want only 2 records like this
1, 1, 1, Complaint1, Dengue,2014-06-23
1, 1, 1, Complaint2, fever,2014-06-23
how can i get it.
your help will be appriciatable for me ..
Thanks In Advance