-
select *from user where username like '_a%';查看全部
-
select *from user where username like 'a%';查看全部
-
select username from user where salary>800 and salary<>100.9;查看全部
-
col username clear; col salary clear;查看全部
-
col salary format 9999.9;查看全部
-
修改表查看全部
-
col username format a10; select *from users;查看全部
-
col username heading 用户名; select *from users;查看全部
-
case...when 语句的使用([when后面跟的是判断的条件,then是条件为真是显示出来的东西]): 1、select username,case usersname when 'aaa' then '计算机部门' when 'bbb' then '市场部门' else '其他部门' end as 部门 from users; 2、select username,case when username='aaa' then '计算机部门' when username='bbb' then '市场部门' else '其他部门' end as 部门 from users; *这个的用法就比较灵活*后面可以跟salary的条件。查看全部
-
alter table userinfo_c1 add constraint ck_salary_new check(salary>0);查看全部
-
create table userinfo (id varchar2(10) primary key, username varchar2(20), salary number(5,0) check(salary>0));查看全部
-
create table userinfo_u2 (id varchar2(10) primary key, username varchar2(20)); alter table userinfo_u2 add constraint un_username_new unique(username);查看全部
-
表级设置唯一约束: create table userinfo_u1 (id varchar2(10) primary key, username varchar2(20), constraint un_username unique(username));查看全部
-
create table userinfo_u (id varchar2(10) primary key, username varchar2(20) uniqe, userpwd varchar2(20));查看全部
-
sqlplus中修改显示的字段名: column column_name heading 字段名 column column_name format dataformat; eg:col username format a10; a10表示显示10位字符 col salary format 9999.9 9表示一位数字,4位整数,1位小数 col salary format $999.9 清除格式: column column_name clear;查看全部
举报
0/150
提交
取消