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
HARI KRISHNAHARI KRISHNA 

Dynamic Query giving wrong result

Hi Friends,

Please check the screen shots:
Check the Query here:-

User-added image

Check the result here:

Problem on Database.Query method
Best Answer chosen by HARI KRISHNA
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello HARI KRISHNA,

What's wrong in the query did you find??

"eeretsavd" is just the alias for the lead. You should know about the 'Alias' in the relational databse. 

You can the run the query like this also - 

"SELECT eeretsavd.id, eeretsavd.name FROM Lead eeretsavd"

Please, have a look at this - 
http://www.crmsalesforcetraining.com/alias-notations-in-soql-basic-soql-statements/

Hope this helps you.

Thanks,
Sumit Kumar Singh
 

All Answers

Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello HARI KRISHNA,

What's wrong in the query did you find??

"eeretsavd" is just the alias for the lead. You should know about the 'Alias' in the relational databse. 

You can the run the query like this also - 

"SELECT eeretsavd.id, eeretsavd.name FROM Lead eeretsavd"

Please, have a look at this - 
http://www.crmsalesforcetraining.com/alias-notations-in-soql-basic-soql-statements/

Hope this helps you.

Thanks,
Sumit Kumar Singh
 
This was selected as the best answer
HARI KRISHNAHARI KRISHNA
Thank you so much Mr.Sumit kumar.