[SalesForce] SOQL Relationship Query : Compare Child and Parent field value in WHERE clause

Is it possible to compare the Child and Parent field values in a Single SOQL Relationship Query ?

say get me all contacts for an account which doesn't have same name as its parent account.

SELECT Contact.Id, Contact.Name, Account.Id, Account.Name
FROM Contact
WHERE Account.Id = 'xxxxxxxxxxx' AND
      Contact.Name <> Account.Name

or get me all opportunities for an account which has same LeadSource as Account

SELECT Id, LeadSource, Account.LeadSource
FROM Opportunity 
WHERE AccountId in : accIdSet AND 
LeadSource <> Account.LeadSource

Best Answer

I don't think so. The field expression in the where clause can include only 1 field name and not 2. It must be compared to a native value.

http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_fieldexpression.htm#fieldexpression