Difference between revisions of "Database Queries"
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
; select distinct column form tableName | ; select distinct column form tableName | ||
: will display only unique results (no duplicates) | : will display only unique results (no duplicates) | ||
; select firstname || ' ' || lastname from tablename | |||
: will concatenate first and last name into one field (the ' ' between the || inserts a space) | |||
; select fristname || ' ' || lastname "Customer Name" from table name | |||
: this will add a alias for the column heading called Customer Name | |||
[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] | [[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] |
Revision as of 23:52, 12 September 2017
Select Command
- select * from tableName
- Select all columns from the table
- select column1, column2 from tableName
- Select 2 columns for the tableName table
- select distinct column form tableName
- will display only unique results (no duplicates)
- select firstname || ' ' || lastname from tablename
- will concatenate first and last name into one field (the ' ' between the || inserts a space)
- select fristname || ' ' || lastname "Customer Name" from table name
- this will add a alias for the column heading called Customer Name