Skip site navigation (1) Skip section navigation (2)

Is not equal to query...

From: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Is not equal to query...
Date: 2011-06-08 21:57:34
Message-ID: BANLkTikpqm1S7O+YQDuHD4P-o-FoTBr6JQ@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi everyone,

A bit of help please. This query works for me, and gives me 332,000
rows of records out of my table of 400,000 rows. It takes about a
minute to run.

SELECT vehicle.*
FROM vehicle, incidents
WHERE incidents.key = vehicle.incident_link;

Would I would like to do however, is remove the data from this table
that does not match the above query. So to start with, I thought that
I'd better try and identify this data using the query below. You'll
note I have simply changed the '=' for '!=' instead.

SELECT vehicle.*
FROM vehicle, incidents
WHERE incidents.key != vehicle.incident_link;

However when I run this query, after about 10-15 minutes, I still
don't have a result. I don't really understand why not.

Cheers as always.

James

Responses

pgsql-novice by date

Next:From: Merlin MoncureDate: 2011-06-08 22:24:46
Subject: Re: Is not equal to query...
Previous:From: Erasmo Zottola - ElmanDate: 2011-06-08 14:39:35
Subject: PL/pgSQL editor/debugger

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group