The Language of SQL- P10

The Language of SQL- P10: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. | Character Functions 31 it returns this data The Answer sun I included a column alias so the resulting data looks nicer. Note that there is no FROM clause in the SELECT statement. Instead of retrieving data from a table you re selecting data from a single literal value namely sunlight . Strictly speaking a FROM clause isn t necessary in a SELECT statement although in practice you would seldom write a SELECT statement like this. I m writing the SELECT statement in this manner without a FROM clause only because it makes it easier to illustrate quickly how functions work. DATABASE DIFFERENCES Oracle Unlike Microsoft SQL Server and MySQL Oracle does require a from clause in all select statements. If run in Oracle all the examples in this chapter would require a from clause to be added. However the table provided in the FROM clause does not have to be a real table. Oracle provides a special dummy table called dual. The use of the dual table will be illustrated later in this chapter. Let s look at the format of this function in greater detail. The general format of the LEFT function is LEFT Charactervalue NumberOfCharacters All functions have any number of arguments within the parentheses. For example the previous LEFT function has two arguments CharacterValue and NumberOfCharacters. The term arguments is a commonly used mathematical term that describes a component of functions and has nothing to do with anything being disagreeable or unpleasant. Basically each function is unique and the various arguments that are defined for each function are what truly define the meaning of the function. In the case of the LEFT function the CharacterValue and NumberOfCharacters arguments are both needed in order to define what will happen when the LEFT function is invoked. The LEFT function has two arguments. Other functions may have more or fewer arguments. Functions are even permitted to have no arguments. But even if there are no arguments all functions have a set of parentheses .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
54    473    8    02-07-2024
Đã 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.