+ Start a Discussion
CoderCoder 

How to display the DISTINCT records from salesforce to PHP page?

Hi,

     I have created a PHP page in that i wrote a query to retrieve the records from salesforce.com. The query works fine and displaying the records. Now i want to display the DISTINCT records in PHP page, as salesforce.com doesn't support DISTINCT keyword can anyone tell me is there anyother way to get the DISTINCT records.

 

I have tried a function array_unique() also but its showing all the records. Pls kindly tell the alternative solution to get the DISTINCT records.

 

Message Edited by Coder on 07-17-2009 09:10 PM
ptepperptepper

Hello,

 

Honestly, it's considered bad forum etiquette to post a question before you've searched the forum for the answer. This has been asked and answered several times. SOQL is not SQL and it does not have the DISTINCT clause. Just a search and few results...

 

http://www.developerforce.com/search/search.php?q=DISTINCT+soql&x=0&y=0&site=Discussions&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&client=google-csbe&cx=005575733618104622983%3A0wh7r43n1fy

 

http://community.salesforce.com/sforce/board/message?board.id=general_development&thread.id=8228

 

http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=25060

 

http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=2869

 

 You can also look at the PHP docs for array_unique which removes duplicates from an array.

 

-paul

Message Edited by ptepper on 07-11-2009 02:46 PM
Message Edited by ptepper on 07-11-2009 02:46 PM