I'm looking for a way to do this as well... I'm working with a child object subquery and need a good way to access the list of children from my query results
"Alias" only work with aggregate functions. if you use alias in normal SOQL query you will get error like this,
MalformedQueryFault :
<ns1:exceptionCode>MALFORMED_QUERY</ns1:exceptionCode><ns1:exceptionMessage>only aggregate expressions use field aliasing</ns1:exceptionMessage><ns1:row>-1</ns1:row><ns1:column>-1</ns1:column>
Hi,
By "AS" , do you mean you want to query for names which are like the string you are searching for?
There are no field alias's in SOQL, only object aliases.
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Best I know you use Alias if you grouo by
select id, Name n from Account group by Id, Name..
Does anyone know without using group by ?
I'm looking for a way to do this as well...
I'm working with a child object subquery and need a good way to access the list of children from my query results
You access the child records by using the relationship name. The relationship between the Account and Contact objects is named 'Contacts'.
Hi,
"Alias" only work with aggregate functions. if you use alias in normal SOQL query you will get error like this,
MalformedQueryFault :
<ns1:exceptionCode>MALFORMED_QUERY</ns1:exceptionCode><ns1:exceptionMessage>only aggregate expressions use field aliasing</ns1:exceptionMessage><ns1:row>-1</ns1:row><ns1:column>-1</ns1:column>