Im writing a query in a Batch Apex Job.
I want to return records whose parent account field is NULL from Account object.
The Parent Account is a Hierarchy type. Its Label is "Parent Account" and field name is "Parent".
The following query gives error.
'select ID,Name,Parent,Region__c,Bi_Annual_Revenue__c from Account where Parent.id = null'; 18:44:29.064 (64189694)|EXCEPTION_THROWN||System.QueryException: No such column 'Parent' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Please let me know how to refer to the parent field in the query.
I removed the parent field from the select statement and its working. I dont need that.
Thanks for the responses.