主键:(oracle一般用序列,mysql一般用自动增长类型auto increment)
alter table temp_huawangxin modify id int(100) not null auto_increment ;
--删除
Alter table temp_huawangxin change id id int(10);//删除自增长
Alter table temp_huawangxin drop primary key;//删除主建
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
翻页机制:(oracle比较繁琐,用ROWNUM,mysql用limit)
-------------------------------------------------------------------------------------------------------
索引:
--oracle 非唯一性索引
create index index_a on table_a(id);
-------------------------------------------------------------------------------------------------------
模糊查询:
--oracle 两种,第二种适用于name字段为索引时更高效
select * from tb where name like '%XX%';
select * from tb where instr(name,'XX')>0;
--instr(title,'测试')>0 相当于 title like '%测试%'
--instr(title,'测试')=1 相当于 title like '测试%'
--instr(title,'测试')=0 相当于 title not like '%测试%'
未完待续。。。。。。