You need to sign in to do that
Don't have an account?
sampath palli
Can i give more than one field in where condition in SOQL
I have an requirement that i need to retrive both name and password data from sobjecct which are given in vf page . I have write a soql query in apex controller like this way but it is working please suggest me
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname,Password__c=:pwd;
Thanks in advance
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname,Password__c=:pwd;
Thanks in advance
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname,Password__c=:pwd;
where clause doesnot support "," and you should use logical operators (AND , OR etc..) depends on your criteria.
you can use like below,
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname AND Password__c=:pwd;
let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com
All Answers
[select Rum_Name__c,Password__c from Registartion__c where (Rum_Name__c = :rname and Password__c=:pwd)]
Please find the below query:
You can either way, based on your requirement.
Also find the below information for your reference and understanding of SOQL.
https://developer.salesforce.com/docs/atlas.en-us.200.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_conditionexpression.htm
https://developer.salesforce.com/trailhead/en/apex_database/apex_database_soql
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_examples.htm
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL.htm
Please do let me know if it helps you.
Regards,
Mahesh
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname,Password__c=:pwd;
where clause doesnot support "," and you should use logical operators (AND , OR etc..) depends on your criteria.
you can use like below,
select Rum_Name__c,Password__c from Registartion__c where Rum_Name__c = :rname AND Password__c=:pwd;
let me know, if it helps you or need any help :)
shiva.sfdc.backup@gmail.com