Chinaunix首页 | 论坛 | 博客
  • 博客访问: 313652
  • 博文数量: 29
  • 博客积分: 698
  • 博客等级: 上士
  • 技术积分: 293
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-11 11:14
文章分类

全部博文(29)

文章存档

2013年(2)

2012年(5)

2011年(22)

分类: Oracle

2011-04-25 17:04:46

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) |
给主人留下些什么吧!~~