
December 7th, 2012, 06:54 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 75
Time spent in forums: 1 Day 3 h 26 m 46 sec
Reputation Power: 4
|
|
|
Select rows which have no match in other table?
I have this structure
tbl_site_urls: storing urls of a site
tbl_camp_urls: storing urls of a campaign, after handling these urls
tbl_site_urls
id - site_id - url
1 - 181 - url1
2 - 182 - url2
3 - 189 - url3
tbl_camp_urls
id - camp_id - site_id - url
1 - 5 - 181 - url1
if i want to list the urls need to be handle
select url from tbl_site_urls
join site on tbl_site_urls.site_id = site.id AND site.valid=1
then in a loop operation i insert the handled urls into the tbl_camp_urls
I want to list the urls that which have not handled yet.
it is like a comparison operation.
The results I'm expecting is
2 - 182 - url2
3 - 189 - url3
|