查询:
普通查询:
select * from userlist;
条件查询:
select * from userlist where name = '张三';
删除重复项:
select distinct(name) from userlist ;
取前N行:
select *,rownum from userlist where rownum <=N;
排序:
select * from userlist order by id desc; 降序
select * from userlist order by id asc;升序
改变显示:
select id,name,decode(status,'N','未确定','Y','已确定') from userlist
日期操作:
select trunc(sysdate) from dual
长度计算:
select name,length(name) from TEST
新增:
insert into userlist(id,name,birthday,operator,sysdate)values(1,'张三','2014-01-01','李四')
更新:
update userlist set id = '2' where name = '张三'
复制: