select *|列名|表达式 from 表名 where 条件 order by 列名
select t.* from STUDENT.STUINFO t where t.stuname = '李四';
select t.stuid,t.classno,t.stuaddress,t.grade from STUDENT.STUINFO t where t.stuname = '李四';
select t.* from STUDENT.STUINFO t where t.classno = 'C201801' ORDER BY T.AGE ASC;
create table 表名 as select 语句
create table student.stuinfo2 as select * from student.stuinfo;
select * from student.stuinfo2;
insert into 表名(列名1,列名2,列名3.....) values(值1,值2,值3.....);
insert into STUDENT.STUINFO (STUID, STUNAME, SEX, AGE, CLASSNO, STUADDRESS, GRADE, ENROLDATE, IDNUMBER)
values ('SC201801005', '龙七', '1', 26, 'C201801', '福建省厦门市XXX号', '2018', to_date('01-09-2018', 'dd-mm-yyyy'), '3503021992XXXXXXXX');
select * from student.stuinfo t where t.stuid='SC201801005';
INSERT INTO 表名 SELECT 子句
delete from student.stuinfo t where t.stuid in (select b.stuid from student.stuinfo2 b);
insert into student.stuinfo select * from student.stuinfo2;
select * from student.stuinfo;
update 表名 set 列名1=值1,列名2=值2,列名3=值3... where 条件
update student.stuinfo t set t.age = '24', t.idnumber = '3503021994XXXXXXXX' where t.stuname = '张三';
commit;
select * from student.stuinfo t where t.stuname='张三';
update 表1 set 列名=(select 列名 from 表2 where 表1.列名=表2.列名)
where exists (select 1 from 表2 where 表1.列名=表2.列名)
update student.stuinfo t
set (age, idnumber) = (select age, idnumber from student.stuinfo2 b where b.stuid = t.stuid)
where exists (select 1 from student.stuinfo2 b where b.stuid = t.stuid and b.stuname = '张三');
select *from student.stuinfo t where t.stuname='张三';
delete from 表名 where 条件
delete from stuinfo t where t.stuname='张三';
truncate table 表名
truncate table stuinfo2;
手机扫一扫
移动阅读更方便
你可能感兴趣的文章