Re: Trying to match on something that is not there

2004-10-20 Thread Brian
Sorry, I'm used to oracle, thought this was a standard query. > Brian wrote: > > select s.userid from surveyanswers s where s.userid not in (select > > distinct u.id from users u) > > > > > > On Tue, 19 Oct 2004 16:30:29 -0600, Jonathan Duncan <[EMAIL PROTECTED]> wrote: > > > >>I have a user who

Re: Trying to match on something that is not there

2004-10-20 Thread Ludwig Pummer
Or without a subquery, SELECT s.questionid, s.userid FROM SurveyAnswers s LEFT JOIN Users u ON u.id = s.userid WHERE u.id IS NULL; Brian wrote: select s.userid from surveyanswers s where s.userid not in (select distinct u.id from users u) On Tue, 19 Oct 2004 16:30:29 -0600, Jonathan Duncan <[EMAI

Re: Trying to match on something that is not there

2004-10-19 Thread Brian
select s.userid from surveyanswers s where s.userid not in (select distinct u.id from users u) On Tue, 19 Oct 2004 16:30:29 -0600, Jonathan Duncan <[EMAIL PROTECTED]> wrote: > I have a user who is using the following query to try and delete rows > from one table based on the lack of a user id in

Trying to match on something that is not there

2004-10-19 Thread Jonathan Duncan
I have a user who is using the following query to try and delete rows from one table based on the lack of a user id in another table: SELECT s.questionid, s.userid, s.questionanswer FROM Users u, SurveyAnswers s WHERE u.id != s.userid The corresponding user rows have already be deleted from the t