Re: select statement question

2007-01-05 Thread Brent Baisley
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

Re: select statement question

2007-01-03 Thread Chris White
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

RE: select statement question

2007-01-03 Thread Jerry Schwartz
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

RE: select statement question

2003-10-22 Thread Dan Greene
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

Re: SELECT Statement Question

2002-11-20 Thread John Ragan
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

Re: SELECT Statement Question

2002-11-20 Thread Ray
> 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

RE: SELECT Statement Question

2002-11-20 Thread Fernando Grijalba
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