TAILIEUCHUNG - The Language of SQL- P21

The Language of SQL- P21:Research has shown that, being pressed for time, most readers tend to skip the introduction of any book they happen to read and then proceed immediately to the first real chapter. With that fact firmly in mind, we will only cover relatively unimportant material in the introduction, such as an explanation of what you will and will not learn by reading this book. | 86 Chapter 9 Inexact Matches MovieID MovieTitle 1 Love Actually 2 His Girl Friday 3 Love and Death 4 Sweet and Lowdown 5 Everyone Says I Love You 6 Down with Love 7 101 Dalmatians In this example the percent symbol is used as a wildcard. The percent wildcard means any characters. It can also represent a list of zero characters. The percent before LOVE means that you will accept a phrase with any characters before LOVE. Similarly the percent after LOVE means that you will accept a phrase with any characters after LOVE. DATABASE DIFFERENCES Oracle Unlike Microsoft SQL Server and MySQL Oracle is case sensitive when determining matches for literal values. In Oracle LOVE is not the same as Love. An equivalent statement in Oracle is SELECT MovieTitle AS Movie FROM Movies WHERE MovieTitle LIKE Love A better solution in Oracle is to use the upper function to convert your data to uppercase as follows SELECT MovieTitle AS Movie FROM Movies WHERE UPPER MovieTitle LIKE LOVE In other words you are looking for any movie title that contains the phrase LOVE. Here is the data returned from the previous SELECT Movie Love Actually Love and Death Everyone Says I Love You Down with Love Pattern Matching 87 Notice that LOVE appears as the first word the last word and sometimes in the middle of the movie title. Let s now attempt to find only movies that begin with LOVE. If you issue SELECT MovieTitleAS Movie FROM Movies WHERE MovieTitle LIKE LOVE you will only retrieve this data Movie Love Actually Love and Death Since you are now specifying the percent wildcard after the phrase LOVE you will only get back movies that begin with LOVE. Similarly if you issue SELECT MovieTitleAS Movie FROM Movies WHERE MovieTitle LIKE LOVE you only get this data Movie Down with Love This is because you now specified that the phrase must end with the phrase LOVE. What if you only want to see movies that contain the word LOVE in the middle of the title but you don t want to see movies where it is at the .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.