I have Trigger,in Trigger I have one select query.That select query returns duplicate records. My query is :
LIST<Company__c> li = LIST<Company__c>();
LIST<String> companynames= LIST<String>();
companynames.add('tempabc');
companynames.add('tempabc1');
li= [SELECT Id,Name FROM Company__c WHERE Name IN : companynames];
Note : The Company names come from dynamic list when the Trigger is fired as of now I am hard coded.
But Now I am getting the 3 records from the Company Object. 1).Name=tempabc 2).Name=tempabc 3).Name=tempabc1
I need to query the without duplicate records? Please some one help me.
Best Regards, Ramesh