0% found this document useful (0 votes)
18 views

2 type Query - Copy (2)

Uploaded by

anmolpogo52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

2 type Query - Copy (2)

Uploaded by

anmolpogo52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

2 type Query

1. SOQL : Salesforce Object Query Language


2, SOSL: Salesforce Object Search language

SOQL:
Return Type: List<sObject>
Limit: 50000
DML Perform (Insert, Update,Delete Upsert)

1. SELECT Id,Name FROM Account : Specific field


2. SELECT Fields(ALL) FROM Account LIMIT 200 : all fields from sObject
3. SELECT Id,Name FROM Account LIMIT 5
4. SELECT Id,Name FROM Account WHERE Name = 'Test'
5. SELECT Id,Name,createdDate FROM Account WHERE Name = 'Test' ORDER BY CreatedDate
6. SELECT Id,Name,createdDate FROM Account WHERE Name = 'Test' ORDER BY CreatedDate
ASC
7. SELECT Id,Name,createdDate FROM Account WHERE Name = 'Test' ORDER BY CreatedDate
ASC LIMIT 1
8. SELECT Id,Name,createdDate FROM Account WHERE Name = 'Test' ORDER BY CreatedDate
DESC
9. SELECT Id,Name,createdDate FROM Account WHERE Name = 'Test' ORDER BY CreatedDate
DESC LIMIT 1
10. SELECT Id,FirstName,createdDate FROM Contact ORDER BY FirstName NULLS First
11. SELECT Id,FirstName,createdDate FROM Contact ORDER BY FirstName NULLS Last

Custom Object Query:

1. SELECT Id, createdDate FROM Bank__c

Parent to child query


1. SELECT Id,Name,(SELECT Id,FirstName,LastName FROM Contacts) FROM Account

Child to parent Query:


1. SELECT Id,Account.Name,Account.Phone FROM Contact
Parent 1

Child 1
Child 2

SELECT Id,Account.Name,Account.Phone FROM Contact

SELECT : SOQL Keyword

Id,Name: sObject Fields

FROM: SOQL Keyword

ACcount: sObject

SOSL:
Return Type: List<List<sObject>>
Limit more than 50K to 5Million
DML Not allowed

FIND Id,Name FROM Account

array []
List<>

You might also like