TalentGMU
04-03-2007, 09:46 PM
I am stuck in a bit of a problem. I am using the statement:
select count(refs_id) from refs, people, jobs where refs.cid=people.cid and refs.reference=jobs.reference and (jobaccountmanager='Someone' or candidrecruiter='Someone');
now my problem is if an interview(refs) is made by 'Someone' who is the jobaccountmanager AND the candidrecruiter then the above statement returns 1 where I want it to return 2. Basically as soon as jobaccountmanager='Someone' it short circuits and doesn't check the candidrecruiter. I need to find a way for count to return 2 instead of one. Is there a non-short circuit method for or in sql? Plus I know this could be solved if I would just split the select statement into two statements and then add but to make a long story short that is not an option. Help would be GREATLY appreciated.
select count(refs_id) from refs, people, jobs where refs.cid=people.cid and refs.reference=jobs.reference and (jobaccountmanager='Someone' or candidrecruiter='Someone');
now my problem is if an interview(refs) is made by 'Someone' who is the jobaccountmanager AND the candidrecruiter then the above statement returns 1 where I want it to return 2. Basically as soon as jobaccountmanager='Someone' it short circuits and doesn't check the candidrecruiter. I need to find a way for count to return 2 instead of one. Is there a non-short circuit method for or in sql? Plus I know this could be solved if I would just split the select statement into two statements and then add but to make a long story short that is not an option. Help would be GREATLY appreciated.