View Single Post
Old 04-03-2007, 02:23 AM  
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
any mysql gurus here?

ok, this is weird... at least for me...
i have three tables
sites - id (autoinc), name, url
dumps - id (autoinc), name, url
posted - id (autoinc), dumpid, linkid, date
i want to show in a query all combinations of sites+dumps that do not exist in posted. (which means links that have not been submitted to dumps).
i am using the following query and it works great in MS sql, but in My sql i always get records back although all combos exist in posted...

Code:
SELECT site, dumpi, sitename, dumpname, dumpurl, siteurl
FROM
(SELECT sites.id AS site, 
     dumps.id AS dumpi, 
     sites.name AS sitename, 
     dumps.name AS dumpname, 
     dumps.url AS dumpurl, 
     sites.url AS siteurl 
FROM sites, dumps) Q
LEFT JOIN posted on
Q.site = posted.siteid
and Q.dumpi = posted.dumpid
WHERE posted.stieid IS NULL

could anybody please take a look at this and tell me, where i am wrong?

thanks a lot!!!
__________________
Make Money
martinsc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote