不是人为的那样向student中插值(insert into student values('?','?','?','?'))
?代表实际数据?——————就算是自动的也要通过这个语句实现啊!
排序!
select * from student order by 字段名;
?代表实际数据?——————就算是自动的也要通过这个语句实现啊!
排序!
select * from student order by 字段名;
然后使用select * from student order by 字段名;
直接通过oracle怎么实现?
CREATE SEQUENCE student_id INCREMENT BY 1 START WITH 1then you can use it in your INSERT statement
insert into student values(student_id.CURRVAL,'?','?','?')select * from table_name order by fields_list
nsert into sunyu values('sunyu_id.currval','lisi')
*
RROR 位于第 1 行:
RA-00942: 表或视图不存在
怎么不可以?
SQL> insert into sunyu values(sunyu_id.currval,'li');
insert into sunyu values(sunyu_id.currval,'li')
*
ERROR 位于第 1 行:
ORA-00942: 表或视图不存在
insert into student (sunyu_id.currval,'li');
就不是语法问题了,是用户权限问题了!
create or replace trigger trigger_name before insert on 你的表
as
begin
select 序列.nextval into :new.id from 序列名;
end