I believe this would work
select table1.* table1 left join table2 on (table1.id=table2.id) where tab2.id not null


The left join will match the values together. Null values are inserted where matches are not made. Since 4 will not make a match null values will be put in place of the table2 values.

Joe

On Wednesday, January 21, 2004, at 08:26 PM, Randy Johnson wrote:




This example is simplified. I hope you understand


Each table has one field called ID which is an integer and is the primary key


Table 1 List of Programs 1 2 3 4 5 6 7 8 9 10





Table 2
Programs members have joined
1
5
8



Here is the scenario. I want to compare the values in table one and Table 2

if the value in table one is not in table 2 then display the number to the screen?

Can somebody show me what the sql statement would look like?

Thanks

Randy


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to