On Thu, 2007-10-04 at 11:56 +1000, Chris wrote:
Robert Cummings wrote:
On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only
been using PostgreSQL
left join where item in right table is null
"Chris" [EMAIL PROTECTED] 10/3/2007 10:32:01 PM
Aleksandar Vojnovic wrote: I would also suggest to limit yourself to things you actually need not to select the whole table.In this case you can't because you're looking for records that exist in
John A DAVIS wrote:
left join where item in right table is null
That's still going to look at all records in both tables:
1) so it can work out if there is a match from table 1 to table 2
2) so it can then remember to display any records that don't have a match
I was thinking more that if
On 10/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi J,
Checkout this,
SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)
Brilliant! This is exactly what I was looking for, and is quite
logical/readable! Thanks to everyone for the ideas!
J
I agree with this. Never use a subquery when a join will work. The
optimizer with thank you with performance.
James Ausmus wrote:
On 10/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi J,
Checkout this,
SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)
@lists.php.net
Subject: [PHP-DB] Re: [PHP] RE: the opposite of a join?
On 10/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi J,
Checkout this,
SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)
Brilliant! This is exactly what I was looking
Colin Guthrie wrote:
Martin Marques wrote:
SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts);
Not ideal as has been mentioned else where in this thread.
Col
I think one would have to take into account the DB type being used here.
I can have MySQL and PostgreSQL setup
On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been
using PostgreSQL for a
year or so. But one problem that I have always ran into with
Robert Cummings wrote:
On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a
year or so. But one problem that I have always
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a
year or so. But one problem that I have always ran into with MySQL is that when JOIN'ing tables
that have large data
I would also suggest to limit yourself to things you actually need not
to select the whole table.
Aleksandar
Jim Lucas wrote:
Colin Guthrie wrote:
Martin Marques wrote:
SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts);
Not ideal as has been mentioned else where in
Aleksandar Vojnovic wrote:
I would also suggest to limit yourself to things you actually need not
to select the whole table.
In this case you can't because you're looking for records that exist in
one table that don't exist in another.
Apart from looking at the whole table in each case how
It seems you missed my point :) if you would need all the data then
select them all, but if you need only partial data from the table then
you could limit yourself to that specific columns. I doubt everybody
need everything all the time. True?
Aleksandar
Chris wrote:
Aleksandar Vojnovic
Aleksandar Vojnovic wrote:
It seems you missed my point :) if you would need all the data then
select them all, but if you need only partial data from the table then
you could limit yourself to that specific columns. I doubt everybody
need everything all the time. True?
Ahh - you meant the
14 matches
Mail list logo