oracle的select语句例句
set lines 300;
select * from employees;
select first_name from employees;
select first_name,last_name from employees;
select first_name name from employees;
select first_name||last_name from employees;
select first_name||‘--->’||last_name from employees;
select first_name||q‘['s job is a ]'||job_id from employees;
select last_name,salary from employees where salary >= 3000;
select last_name,job_id,salary from employees where job_id =‘SA_REP’;
select last_name,job_id,salary from employees where job_id like‘SA_REP';
select last_name,job_id,salary from employees where last_name like ‘_a%';
select last_name,job_id,salary from employees where job_id like ‘SA\_%' escape ‘\’;
select last_name,job_id,salary from employees where job_id like‘SA_%' and salary > 3000;
select last_name,salary 300 from employees;
select last_name,12*salary 300 from employees;
select last_name,12*(salary 300) from employees;
select last_name,job_id,department_id,salary from employees order by 4;
select last_name,job_id,department_id,12*salary years from employees order by last_name,years;
select last_name,salary from employees order by last_name,salary desc nulls last;
select last_name,&column_name from employees where &conditions order by &sort;
select last_name,&&column_name from employees order by &column_name
========
set define employee_num = 123
select employee_id,last_name,salary from employees where employee_id = employee_num;
undefine employee_num = 123
========
set verify on(/off)
select last_name,&&column_name from employees order by &column_name
=========================================================================================
功能篇
select * from tab where tabtype = ‘TABLE' ;查看当前用户下的表
select count(*) from employees;查询表中记录的行数
set linesize 200 设置一行显示200个字符
set pagesize 20 设置每页显示20行
阅读(838) | 评论(0) | 转发(0) |