as
select job.dm_session_id as myid,
http.dm_request_size as insize,
http.dm_response_size as outsize,
job.begin_time_stamp as statrtime,
job.end_time_stamp as endtime,
job.job_id as jobid,
job.device_external_id as imeiid,
http.client_ip as ip,
http.user_agent as useragent
from V_DM_TRACKING_LOG_JOB_SUM job,DM_TRACKING_LOG_HTTP http where job.Dm_Session_Id=http.dm_session_id
1.先清理现有的数据并规划只能一个主键,或者考虑组合主键(即ID列与另一个关键列组合成主键)2.通过SQL增加主键:alter table tabname add constraint tabname_pk primary key (id) enable validate
组合键:alter table tabname add constraint tabname_pk primary key (id,另一列名) enable validate
1.先建一个序列:
-- Create sequencecreate sequence auto_id
minvalue 1
maxvalue 9999999999999
start with 1
increment by 1
cache 10
2.创建触发器:
create or replace trigger auto_col_triggerbefore insert on auto_tab
for each row
declare
v_id number := 0
begin
select auto_id.nextval into v_id from dual
:new.id := v_id
end
我随便写的,表名和字段名改一下就行了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)