Re: distinct clause issue for 600000 records
> Ra Nala : I should use Left join only why because
> i want each and every records from left table i.e
> main table: prdsl even though null records
> retrieve if the join condition is not matched from
> right table in my scenario.
No sure that holds in your case, but sometimes there will always be a match in right hand table (i.e., foreign key relationship). If so, you will not need to use LEFT to get "every record from the left table". E.g., in your query, if all values of rn.cbed refers to a valid id in bcu, LEFT can be dropped. (You can use foreign keys to ensure such relationships.)
Note also that you do not need to use LEFT JOIN "all the way" to get all rows of the left-most table. For example, this will still give all rows of table t1:
t1 LEFT JOIN (t2 JOIN t3 ON ...) ON ...
Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway
Subject
Views
Written By
Posted
1768
November 10, 2015 08:57AM
953
November 11, 2015 12:33PM
801
November 12, 2015 12:49AM
948
November 12, 2015 03:20AM
870
November 12, 2015 07:24PM
1019
November 12, 2015 07:08AM
896
November 12, 2015 07:18AM
881
November 12, 2015 07:43AM
950
November 13, 2015 12:37AM
882
November 13, 2015 12:45AM
915
November 13, 2015 02:42AM
942
November 13, 2015 05:56AM
Re: distinct clause issue for 600000 records
933
November 13, 2015 06:38AM
982
November 13, 2015 07:15AM
991
November 13, 2015 08:11AM
940
November 13, 2015 11:35AM
998
November 16, 2015 03:04AM
925
November 16, 2015 04:12AM
859
November 16, 2015 05:54AM