码迷,mamicode.com
首页 > 其他好文 > 详细

select 练习语句

时间:2017-10-04 14:20:42      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:显示   全局   for   desc   nbsp   编号   工资   名称   详细信息   

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 练习语句

标签:显示   全局   for   desc   nbsp   编号   工资   名称   详细信息   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!