Re: Calling all QUERY-GURUS! Help on Collaborative Filtering
Posted by: Anna Sobiepanek
Date: January 31, 2007 12:52PM

I think it would help if you give the structure of the table and an explanation of what you want done.
As for your sample code: 1. "Cust_ID IN(...)" I would use exists instead of IN
2. you are doing 2 selects of the same table, i don't know it that is allowed, isnt there another table where the Cust_id and booktitle exists?I think the reason why it is crashing is because it is selecting from itself which throws it into a loop.
------------------------------------------------
http://dev.mysql.com/doc/refman/5.0/en/exists-and-not-exists-subqueries.html

I think this is more for making sure the field exists in another table.
I use it to make sure that all of the FK in a sample database exist in the parent table before i populate the regular database.

SELECT DISTINCT BOOKTITLE b FROM bookstitles
WHERE (BOOKTITLE!='DaVinci Code')
and EXISTS (SELECT * FROM books s WHERE b.CUST_ID = s.CUST_ID);

Options: ReplyQuote


Subject
Written By
Posted
Re: Calling all QUERY-GURUS! Help on Collaborative Filtering
January 31, 2007 12:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.