Activity Forums Salesforce Discussions Can we use aliasing in Salesforce?

  • Can we use aliasing in Salesforce?

  • Shubham

    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?


    February 11, 2020 at 6:41 pm

    SOQL has very limited aliasing support. We can alias the table, e.g. SELECT 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 7 months, 1 week ago by  Forcetalks.
Viewing 1 - 2 of 2 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos