You want to use a LEFT JOIN, which will select all the records from A and link them with records in B if there are any. If there are
no matches in B, the the fields from B will be NULL. You then just check for the NULL value (no match) in a B field and use that as
your filter.
SELECT A.*,B.D FR
Aaron Cannon wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi all. I hope this is the right place to ask this.
I have two tables, A and B. Each of these tables has a column with
integers. The column in table A is C and the one in B is D.
SELECT c.value FROM c WHERE c.value NOT IN
I think you want
SELECT * FROM a LEFT JOIN b on a.c = b.d WHERE b.d IS NULL;
The LEFT JOIN means to create a composite record from both tables even if
there is no match on the right-hand table. Checking to see if b.d is null
selects out those composite records that came up empty on the right-hand
from one dan to another.
select man.description as man_description, cat.description as cat_description
from main_table as main, manufacturer_table as man, categories_table as cat
where main.manufacturer_id = man.manufacturer_id
and main.category_id = cat.category_id
and title_id = 3
Dan
thanks for the chuckle. we've all been beginners
and i still do dumb things with sql.
download corereader from http://corereader.com
it will let you click on the database objects to
build your queries. when you click on your table
name and your field name, it will return the data
to you an
> When I run SELECT * FROM POSTCODE; in mysql prompt I get garbled display of
> data and some of my data is not shown.
the garbled display is probably due to the results being wider then the
screen/terminal, and since the mysql client doesn't implement a horizontal
scrollbar like a gui/web mysql
You should write:
SELECT postcode FROM TABLE_NAME;
This will display the postcode from your table?
Jfernand
** sql **
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: November 20, 2002 16:12
To: [EMAIL PROTECTED]
Subject: SELECT Statement Question
Hi
I am a