vupax.blogg.se

Pl sql developer describe table
Pl sql developer describe table











pl sql developer describe table

In this example, we've created an alias for the products table called p. ORDER BY p.product_name ASC, categories.category_name ASC ON p.category_id = categories.category_id Let's look at an example of how to alias a table name in Oracle/PLSQL.įor example: SELECT p.product_id, p.product_name, categories.category_name When you create an alias on a table, it is either because you plan to list the same table name more than once in the FROM clause (ie: self join), or you want to shorten the table name to make the SQL statement shorter and easier to read. Since there are spaces in this alias_name, "CONTACT NAME" must be enclosed in quotes. In this example, we've aliased the second column (ie: first_name and last_name concatenated) as "CONTACT NAME". Next, let's look at an example where we are required to enclose the alias_name in quotes.įor example: SELECT contact_id, first_name || last_name AS "CONTACT NAME" However, it would have been perfectly acceptable to write this example using quotes as follows: SELECT contact_id, first_name || last_name AS "NAME" Because our alias_name did not include any spaces, we are not required to enclose the alias_name in quotes. As a result, NAME will display as the heading for the second column when the result set is returned.

pl sql developer describe table

In this example, we've aliased the second column (ie: first_name and last_name concatenated) as NAME. For example, when concatenating fields together, you might alias the result.įor example: SELECT contact_id, first_name || last_name AS NAME Generally, aliases are used to make the column headings in your result set easier to read.













Pl sql developer describe table