I have 2 fields in my Search function with Account Name and Contact Name. The scenario will be, If the Contact Name has a value 'nothing' it will query in the Account to Contact relationship with where clause in contact. So the output will be, the Account which the contact name is equal to 'nothing'.
SOQL Code:
SELECT Id,Name, (SELECT Id,Name FROM Contacts WHERE FirstName = 'nothing' OR LastName = 'nothing') FROM Account
Expected output should be return only the specific 'nothing' in the Contact Name.
BUT when i execute the Query It returns all Account.
Is there any idea to accomplish this scenario?