April 2002
Intermediate to advanced
442 pages
16h 37m
English
When you use column names that are fully qualified with their table and column name, the names can grow to be quite unwieldy. In addition, when referencing SQL functions (which will be discussed later in the chapter), you will likely find it cumbersome to refer to the same function more than once within a statement. You can get around these issues by using aliases. An alias is usually a shorter and more descriptive way of referring to a cumbersome name. You can use it anywhere in the same SQL statement in place of the longer name. For example:
# A column alias SELECT long_field_names_are_annoying AS myfield FROM table_name WHERE myfield = 'Joe' # A table alias SELECT people.names, tests.score FROM tests, really_long_people_table_name AS people
Read now
Unlock full access