首页 > 其他 > 详细

select 练习语句

时间:2017-10-04 13:54:07      阅读:247      评论:0      收藏:0      [点我收藏+]

select * from scott.dept;            /查看scott.dept表中的全局信息。
        describe    scott.emp;            /查看scott.dept表详细信息。
        select ename from scott.dept;        /查看scott.dept表已dname显示出列。
        select enmae,sal from scott.emp;    /查看scott.emp表中所有人的姓名和工资。
        select ename,sal*12 “一年工资” from scott.emp; /查看scott.emp表中所有人的姓名和工资并乘12,并且加上名称。
        select deptno from scott.emp;         /显示部门的编号
        select DISTINCT deptno from scott.emp;/显示部门的编号并且不重复。
        select ename,job from scott.emp;      /显示scott.emp表中所有人名字和工作类型。
        select ename || ‘ ‘ ||job from scott.emp; /查看scott.emp表,结果是:SMITH CLARK 名字和工作在一行显示,并且名字也有变化。
        select ename || ‘工资’ || sal from scott.tmp;/查看scott.tmp表中的姓名-工资-金额#工资是夹在中间的别名。
      select ‘编号:’ || empno || ‘,姓名: ’ || ename form scott.emp;    /结果:编号:7369,姓名:SMITH
        select ename || ‘工资’ || sal || ‘.‘ from scott.tmp;/查看scott.tmp表中的姓名-工资-金额。#工资是夹在中间的别名。

select 练习语句

原文:http://www.cnblogs.com/Juvenile/p/7625308.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!