Please enable JavaScript.
Coggle requires JavaScript to display documents.
Oracle SQL (Functions (case (select product_id ,case when price >200…
Oracle SQL
Functions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
case
select product_id ,case when price >200 then 'over 200' when price>100 and price <=200 then 'between 100 and 200' else 'unknown' end price_group from product
select address_state,case when address_state IN('NY','SC','FL') then 'East' when address_state IN('CA') the 'West' END stat_group FROM customer
Joins
-
-
join
select employee_id,department.department_name from employee join department on employee.department_id=department.department_id
-
-
-
-
-
-
-
View Data
-
-
-
In or Not in
select * from employee where last_name in ('Foster','Elliott','Mitchell');
select * from employee where last_name notin('Foster','Elliott','Mitchell');
all(符合所有項目)
select * from employee where salary> all(30000,40000,50000);
Any(符合任一項目)
select * from employee where salary> any(30000,40000,50000);
-
-
Subqueries
-
select employee_id from employee where department_id in(select department_id from department where department_name in('sales','Finance'))
-
-