tailieunhanh - Oracle SQL Internals Handbook phần 10

Tham khảo tài liệu 'oracle sql internals handbook phần 10', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Breaking the problem down into two parts excluding a document is easy. SELECT DISTINCT document_id FROM Documents AS D1 WHERE NOT EXISTS SELECT FROM ExcludeList AS E1 WHERE This says that you want only the documents that have no matches in the excluded word list. You might want to make the WHERE clause in the subquery expression more general by using a LIKE predicate or similar expression like this. WHERE LIKE OR LIKE OR LIKE OR LIKE This would give you a very forgiving matching criteria. That is not a good idea when you are excluding documents. When you wanted to get rid Smith is does not follow that you also wanted to get rid of Smithsonian as well. For this example Let you agree that equality is the right matching criteria to keep the code simple. Put that solution aside for a minute and move on to the other part of the problem finding documents that have all the words you have in your search list. The first attempt to combine both of these queries is 164 Oracle SQL Internals Handbook SELECT FROM Documents AS D1 WHERE EXISTS SELECT FROM SearchList AS S1 WHERE AND NOT EXISTS SELECT FROM ExcludeList AS E1 WHERE This answer is wrong. It will pick documents with any search word not all search words. It does remove a document when it finds any of the exclude words. What do you do when a word is in both the search and the exclude lists This predicate has made the decision that exclusion overrides the search list. The is probably reasonable but it was not in the specifications. Another thing the specification did not tell us is what happens when a document has all the search words and some extras Do we look only for an exact match or can a document have more keywords Fortunately the operation of picking the documents that contain all the search words is known as Relational Division. It was one of the original .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN