01-PostgreSQL初识
发布时间:2020-12-13 18:11:19 所属栏目:百科 来源:网络整理
导读:--查找SELECT * from users;--插入insert into users values(3,'bb','25','2016-11-29')--更新update users set age=24 where id=1;--删除delete from users where id=1;--LIMITselect * from users limit 1;--limit偏移 offset 第一个数字表示取几个,第二
--查找 SELECT * from users; --插入 insert into users values(3,'bb','25','2016-11-29') --更新 update users set age=24 where id=1; --删除 delete from users where id=1; --LIMIT select * from users limit 1; --limit偏移 offset 第一个数字表示取几个,第二个数字表示从第几个开始取,与mysql相反 select * from users limit 2 OFFSET 1; --over select *,"row_number"() OVER(order by id desc) a from users ; --patition,在分区之上 select avg(age) over (PARTITION by name)from users; --group BY select name,"count"(*) from users group by name; --HAVING select name,"count"(*) from users group by name HAVING "count"(*)>1; --like select * from users where name like '%a%'; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |