function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neha@SfdcNeha@Sfdc 

unexpected token select

hi
  1. This is my query which retrievevs those products which are ordered by more than one customer

List<Contract__c> c=[selectunexpected token: 'select' Product__c from Contract_Line_Item__c where Contract__c IN:
(select Id from Contract__c where Customer__c IN:custIds)];


I get an error for the above line as unexpected token

Any help would be appreciated
Thanks,
Neha
  1.  
Best Answer chosen by Neha@Sfdc
Anoop yadavAnoop yadav
Hi Neha,

Try Like This:

List<Contract__c> c=[select Product__c from Contract_Line_Item__c where Contract__c IN:
([select Id from Contract__c where Customer__c IN:custIds])];

All Answers

Anoop yadavAnoop yadav
Hi Neha,

Try Like This:

List<Contract__c> c=[select Product__c from Contract_Line_Item__c where Contract__c IN:
([select Id from Contract__c where Customer__c IN:custIds])];
This was selected as the best answer
Rabindra BhowalRabindra Bhowal
I trying to use following statement to get all the account name 
SELECT Name FROM Account;

But getting following error message from developer console query editor 
Unknown error parsing query