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
pokpokpalayokpokpokpalayok 

SOQL field alias

Hi,

 

Can anyone suggest how to alias field in SOQL? I'm trying to last 4 field coz it's all in type->User

 

Select a.AccountNumber, a.BillingCity, a.BillingCountry, a.BillingPostalCode, a.BillingState, a.BillingStreet, a.Id, a.Name, Owner.Name as `OName`, CreatedBy.Name as 'CName`, LastModifiedby.Name as `LName` from Account a

 

If these is not possible, can anyone suggest the best approach.

 

thanks.

SuperfellSuperfell
SOQL returns a heirarcichal structure for these types of queries, so you don't need any aliasing, as all the owner fields will be within an owner object.