TAILIEUCHUNG - Oracle SQL Jumpstart with Examples- P4

Oracle SQL Jumpstart with Examples- P4: Review "As a consultant with more than 12 years of experience working with Oracle databases on a daily basis, reviewing this book was a unique and enjoyable experience. The SQL language is without doubt one of the most critical database skills and it is best learned by example. This book addresses that crucial need. Mr. Powell does an excellent job of clarifying the concepts by using meaningful and easy to understand examples. Frankly, I have not come across any other book on SQL that is as good a compilation of SQL concepts in a single. | 120 Sorting Methods BEGIN vSPLIT INSTR pTIME vHOURS TO_NUMBER SUBSTR pTIME 1 vSPLIT-1 vSECONDS TO_NUMBER SUBSTR pTIME vSPLIT 1 RETURN vHOURS vSECONDS 60 EXCEPTION WHEN OTHERS THEN RETURN 0 END And now we can replace the ORDER BY clause with the function as an expression making for a much easier to read ORDER BY clause. The result is shown in Figure . ORDER BY GETTIME PLAYING_TIME NULLS FIRST 3 DESC 1 Figure Using an Expression in the ORDER BY Clause. Please purchase PDF Split-Merge on to remove this watermark. Sorting Methods 121 Obviously a position number cannot be applied to the expression unless the expression is placed into the SELECT list. Note Copying the expression from the ORDER BY into the SELECT columns list could possibly help performance. We can change the query something like that shown following. The expression GETTIME PLAYING_TIME has been added to the query and the ORDER BY clause has been changed to accommodate it. The result in Figure shows the same sorted order on the PLAYING_TIME column value as shown in Figure . SELECT RECORDING_DATE PLAYING_TIME GETTIME PLAYING_TIME TITLE FROM SONG WHERE TITLE LIKE a AND TITLE LIKE e AND TITLE LIKE i ORDER BY 3 NULLS FIRST 4 DESC 1 Figure ORDER BY Clause Expressions Cannot Use Positions. __ Chapter 6 Please purchase PDF Split-Merge on to remove this watermark. 22 Endnotes You have now added most of the fundamental features to the SELECT statement namely the SELECT FROM WHERE and ORDER BY clauses. Later chapters expand on a multitude of other features and mechanisms. The next chapter digresses somewhat and covers operators conditions and pseudocolumns. Endnotes 1. Oracle Performance Tuning for 9i and 10 ISBN 1-55558-305-9 Please purchase PDF Split-Merge on to remove this .

Đã 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.