the code below provide a result too much Infact i want to list the customer that never buy somethink How can i fix the code below
SELECT
webboard.listweb.id,
webboard.listweb.iditempro,
webboard.listweb.url,
webboard.listweb.useradddate,
webboard.listweb.expiredate,
webboard.prorecord.urlpostonweb
webboard.prorecord.urlpostonweb
FROM
webboard.listweb ,
webboard.prorecord
Where listweb.id Not In
(select webboard.prorecord.idlist From webboard.prorecord )
Using the syntax
will perform a cartesian, or cross, join on the tables involved. So for every row in the table
listweball the rows inprorecordare displayed.You need to use an
INNER JOINto only select the rows inlistwebthat have related rows in theprorecordtable. What are the fields which identify the rows (your Primary Keys) and what is the name of the foreign key field in theprorecordtable?EDIT: Just re-read the question and comments and I see you want the rows in
listwebwhich do not have an entry inprorecordYour
SELECTwill then look like: