January 9, 2003 at 1:26 pm
the problem is as follows. i have a database "template" with a table by name template in which all the affiliateids who have templates are listed.
i have a database "member" with table affiliate which has all affiliateids. i want a list of all those affiliateids who have no templates. the solution i can think is compare the tables affiliate and template and then list all the affiliateids who are present in affiliate table and not in template table, how to code it???
January 9, 2003 at 2:48 pm
use a left outer join
select *
from affiliate a
left outer join template t
on a.affiliateid = t.affiliateid
Steve Jones
January 9, 2003 at 3:30 pm
quote:
use a left outer joinselect *
from affiliate a
left outer join template t
on a.affiliateid = t.affiliateid
Steve Jones
http://www.sqlservercentral.com/columnists/sjones
they are in two different databases not in the same one, thank you
January 9, 2003 at 3:32 pm
Then all you have to do is extend the namespace in Steve's query to include the database name. Ex of a namespace :
DBName.OwnerName.TableName.ColumnName
Tim C.
//Will write code for food
One Windows to rule them all, One Windows to find them,
One Windows to bring them all and in the darkness bind them
In the Land of Microsoft where the Shadows lie.
Tim C //Will code for food
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply