日期:2014-05-16 浏览次数:21100 次
-- Create table
create table T_GG_MOBILENO_SENDABLE
(
sendable_id NUMBER(10) not null,
mobileno_id NUMBER(10),
mobileno NUMBER(11),
mobileno_kind NUMBER(4),
mobileno_age NUMBER(4),
mobileno_money NUMBER(8),
mobileno_area NVARCHAR2(6),
mobileno_sex NUMBER(1),
mobileno_double NUMBER(1),
mobileno_treble NUMBER(1)
)
tablespace GXT
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate indexes
create index INDEX_T_GG_MOBILENO_AGE on T_GG_MOBILENO_SENDABLE (MOBILENO_AGE)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_AREA on T_GG_MOBILENO_SENDABLE (MOBILENO_AREA)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_DOUBLE on T_GG_MOBILENO_SENDABLE (MOBILENO_DOUBLE)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_KIND on T_GG_MOBILENO_SENDABLE (MOBILENO_KIND)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_MONEY on T_GG_MOBILENO_SENDABLE (MOBILENO_MONEY)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_SENDABLE on T_GG_MOBILENO_SENDABLE (MOBILENO)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_SEX on T_GG_MOBILENO_SENDABLE (MOBILENO_SEX)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
create index INDEX_T_GG_MOBILENO_TREBLE on T_GG_MOBILENO_SENDABLE (MOBILENO_TREBLE)
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table T_GG_MOBILENO_SENDABLE
add constraint PK_T_GG_MOBILENO_SENDABLE primary key (SENDABLE_ID)
using index
tablespace GXT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
select count( distinct( MOBILENO))
from t_gg_mobileno_sendable a
WHERE (MOBILENO_KIND = 1
and MOBILENO_AGE >= 0 and MOBILENO_AGE <= 99 and
MOBILENO_MONEY between 0 and 999)