I have used the following query in my custom controller, but apex compiler is not allowing this. How can I recreate this query?
Error: Compile Error: expecting a colon, found EventSchedule__c.Name
Integer capacity= [
SELECT EventSchedule__c.Capacity__c
FROM EventSchedule__c, Ticket__c
WHERE Ticket__c.EventSchedule__c = EventSchedule__c.Name
AND Ticket__c.Date_Time__c=:listStrings.get(i)
AND Ticket__c.Events__c=:listStrings2.get(j)
];