Title: Message
I have found that filtering (whether in a WHERE clause or GROUP BY or ORDER BY) using an alias is unreliable at best. As a matter of habit now, I always use the fully qualified _expression_ instead.
 
In your example, your last line would be "AND userAnswers.answerID <> NULL"
 
Nate
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adaryl Wakefield
Sent: Wednesday, February 18, 2004 10:48 AM
To: [EMAIL PROTECTED]
Subject: [KCFusion] SQL question

Ok ive spent a half hour on this so I think im safe asking a question
I have this monster
SELECT answers.answerID, answers.answerLetter, userAnswers.answerID AS userAnswer, answers.correct, answers.feedback, testQuestions.questionID, testQuestions.question, testQuestions.questionNumber, answers.answer
FROM answers, userAnswers, testQuestions
WHERE answers.answerID *= userAnswers.answerID
AND userAnswers.memberID = 1
AND testQuestions.questionID = answers.questionID
AND testQuestions.testID = 1
AND answers.correct = 1
AND userAnswer AS <> NULL
 
Its the last line that is giving me trouble it does not seem to like to filter on a alias.
 
Adaryl "Did you reboot?" Wakefield
Aviator by passion
Programmer by sheer force of will

Reply via email to