[ Prev ] [ Index ] [ Next ]

查询例子

Created 星期一 03 五月 2010

1 数学中要生成图片的记录

select 编号,内容 from 记.数学 where 编号 not in (select a.编号 from 记.数学图片 as a ,记.数学 as b where a.编号=b.编号 and a.创建时间>b. 最后修改时间);

2 xml的查询
select 编号,标题 from 记.数学 where array_to_string(xpath('/记录/math',内容),',')~'sin';

3 最新的条记录
select 标题,内容 from 记.数学 where 编号=currval('记.数学_编号_seq');

4 当前记录的公式数

	select 编号,公式数 from 记.数学图片 where 编号=22 and 创建时间 in(select max(创建时间) from 记.数学图片 where 编号=22);

5 赋与shcema权限

grant all privileges on schema amarok to amarok;


查询数学笔记


最近的数学记录


select 编号,标题 from 记.数学 where 创建日期>=current_date-90;

更新序列

alter sequence office.书籍信息_编号_seq start with 21;