Activity Forums Salesforce® Discussions Can we use aliasing in Salesforce?

  • Can we use aliasing in Salesforce?

    Posted by Shubham on February 10, 2020 at 3:04 pm

    Can we use aliasing in soql and if we can use it are there any limitations to it?

    MOHIT replied 5 years ago 2 Members · 1 Reply
  • 1 Reply
  • MOHIT

    Member
    February 11, 2020 at 6:41 pm

    SOQL has very limited aliasing support. We can alias the table, e.g. SELECT a.name FROM Account a, but that's of very little use. In most contexts, we cannot alias fields.

    The one exception is for queries that use aggregations, like SELECT COUNT(Id) recordcount FROM Account allows us to alias the result of the aggregation from it's default expr0 to recordCount.

    • This reply was modified 4 years, 12 months ago by  Forcetalks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos