Oracle Basic Queries (BI)
Contents
Selecting
Rows with WHERE condition:
Select Statement:
All the Query to search the result begins from the
select statement.
|
Syntax: |
|
SELECT column_names FROM
table_name [WHERE condition] |
Only the
SELECT and FROM clauses are mandatory. If your query does not have a WHERE
clause, the result will include all rows in the table. If your query has a
WHERE clause then only the rows satisfying the WHERE condition will be
returned.
Example In the BI Queries:
Select person_number
from per_all_people_f
Select person_id
from Per_all_assignments_m
Querying All Data:
The asterisk (*) means all columns in the table. Shows all columns from the table.
|
Syntax: |
|
SELECT * FROM table_name [WHERE
condition] |
Examples in the BI queries:
Select * from per_all_people_f
Select * from per_All_assignments_m
Selecting Specific Columns:
To query specific columns, list the columns in the SELECT
clause. Suppose you want multiple columns in order then list the columns one
by one in the select clause.
|
Syntax: |
|
SELECT Column_name_1,
Column_name_2 FROM table_name |
Examples in BI Queries:
Select person_id , person_number from per_all_people_f
Select assignment_id , person_id from per_all_assignments_m
Selecting Rows with WHERE condition:
To query a specific record or rows, where conditions are
used.
|
Syntax: |
|
SELECT Column_name_1,
Column_name_2 FROM table_name [WHERE
condition] |
Examples in BI Queries:
Select * from per_all_people_f
Where person_number = ‘100’ à Result: All the columns for the record 100 will appear.
Operators:
|
Operator |
Description |
|
= |
Equal to |
|
< |
Less than |
|
> |
Greater than |
|
<= |
Less than or
equal to |
|
>= |
Greater than
or equal to |
|
!= |
Not equal to |
No comments:
Post a Comment