What is the SOQL query to retrieve last row of table?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SOQL is a bit different than SQL.
TOP 1is not valid in SOQL (Salesforce Object Query Language), you would need to useLIMIT 1.Check the documentation:
http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_calls_soql_select.htm
You could try this, too:
SELECT Id From ObjectName__c ORDER BY Id DESC LIMIT 1