I have two tables in my db, Actor and Movie. Both of them contain a field with ActorID, and Id like to put together a query that returns the ones that exist only in Actor.ActorID, and not the ones that exist in both Actor.ActorID and Movie.ActorID.
Is this something anybody could help me with?
Thanks..
/AndreasSelect a.*
from actors a
LEFT OUTER JOIN
movies m ON
a.actor_id = m.actor_id
where m.actor_id is NULL;|||Originally posted by r123456
Select a.*
from actors a
LEFT OUTER JOIN
movies m ON
a.actor_id = m.actor_id
where m.actor_id is NULL;
One way of doing this is
select a.actor_id
from actors a
where not exists (
select 1
from movies m
where m.actor_id=a.actor_id)
you can also use
select a.actor_id
from actors a
where a.actor_id not in (
select actor_id
from movies
)
Showing posts with label movie. Show all posts
Showing posts with label movie. Show all posts
Tuesday, March 27, 2012
Comparing Strings (Advanced Soundex)
Hello,
I need to compare movie names from two systems. In both systems these names are entered manually by operators. I would like to compare them and give a rating on how close these names are equal.
Stripping special characters, and spaces is just not enough. It can happen that they key in sligthly different names. I've tried to use soundex but as we have over 15000 movie titles over the years i'm getting to many equal soundexes to use this as a comparison key.
Any ideas if there are techniques to do this ...
Kind Regards
See if these will help you out any:
http://www.sqlservercentral.com/columnists/mcoles/sql2000dbatoolkitpart2.asp
http://www.sqlservercentral.com/columnists/mcoles/sql2000dbatoolkitpart3.asp
Subscribe to:
Posts (Atom)