![](https://img-blog.csdnimg.cn/2020012215335187.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
PostgreSql
postgreSql数据库
wuyuanshun
这个作者很懒,什么都没留下…
展开
-
ERROR: LIMIT #,# syntax is not supported 建议:Use separate LIMIT and OFFSET clauses.
postgresl ERROR: LIMIT #,# syntax is not supported 建议:Use separate LIMIT and OFFSET clauses.错误:postgresql不支持LIMIT #,#语法建议使用 LIMIT and OFFSET clauses格式详解postgresql 分页取值取第一个值LIMIT 1 OFFSET 0 分页详情请看此文章:postgresql分页查询-sql详细操作步骤....原创 2020-10-22 15:43:15 · 8024 阅读 · 1 评论 -
Error querying database syntax error at or near “$1“
Error querying database syntax error at or near “$4”查询数据库时出错 第4个参数附件语法错误↵### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$4"↵ 位置:665↵### The error may exist in file [E:\demo\service\target\classes原创 2020-10-22 15:32:50 · 3241 阅读 · 0 评论 -
Error querying database.Ran out of memory retrieving query results
Error querying database.Ran out of memory retrieving query results查询数据库时出错 检索查询结果时内存不足错误日志Error querying database. Cause: org.postgresql.util.PSQLException: Ran out of memory retrieving query results.↵### The error may exist in class path resource [xx原创 2020-10-22 15:22:38 · 3786 阅读 · 1 评论 -
java springBoot mybatis Expected one result (or null) to be returned by selectOne(), but found: 2
Expected one result (or null) to be returned by selectOne(), but found: 2error:Expected one result (or null) to be returned by selectOne(), but found: 2解释:selectOne()应返回一个结果(或null),但找到:2从解释可以看出返回值大于1,而只接收了一个,解决方法 在后面加limit分页 只限制一条数据。postgreSql后加 li原创 2020-09-17 13:25:20 · 679 阅读 · 0 评论 -
不同数据库分页 限制第一条postgreSql、mysql、sqlServer、Oracle总结
不同数据库分页 限制第一条postgreSql、mysql、sqlServer、Oracle总结postgreSql后加 limit 1 OFFSET 0select * from table where name='aaa' limit 1 OFFSET 0mysql后加 limit 1select * from table where name='aaa' limit 1 sqlServer查询条件前加 top 1select top 1 * from table Oracle原创 2020-09-17 13:24:31 · 350 阅读 · 0 评论 -
Mybatis boolean和bit不对应 column “xxx“ is of type bit but expression is of type boolean
column “xxx” is of type bit but expression is of type boolean“xxx”列的类型为bit,但expression的类型为booleanpostgre原创 2020-09-03 18:05:20 · 5762 阅读 · 0 评论 -
插入数据库 异常 Data too long for column ‘xxx‘ at row 1
插入数据库 异常 Data too long for column ‘xxx’ at row 1错误日志Data too long for column ‘xxx’ at row 1错误解释“xxx”列的数据太长修改方法修改数据库改字段的长度 加长到合适的长度原创 2020-08-27 08:59:19 · 471 阅读 · 0 评论 -
postgresql分页查询-sql详细操作步骤
postgresql之分页limit查询sqlPostgreSQL 中的 limit 子句用于限制 SELECT 语句中查询的数据的数量。– pageSize:每页显示条数– pageNum:从第几条开始查询– - pageNum= (pageSize-1)*页数下面会有详细解释目录postgresql之分页limit查询sql1.LIMIT 子句的 SELECT 语句1)sql格式2)sql测试2. LIMIT 子句与 OFFSET 子句一起使用1)sql格式2)sql测试1.LIMIT原创 2020-07-07 10:53:24 · 10524 阅读 · 1 评论 -
postgresql去除首尾空格
postgresql去除收尾空格1.主要利用trim函数select trim(' a aa ') trim_name;结果如下:2.更改数据库sqlUPDATE person set age=trim(age) -- WHERE id=1;以防万一 先根据id修改一条数据看看结果,正确的话在全部修改。...原创 2020-05-25 19:50:56 · 5413 阅读 · 0 评论 -
postgresql数据库查询所有表名
SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg%' AND tablename NOT LIKE 'sql_%' ORDER BY tablename;参考链接:https://blog.csdn.net/wukubobo/article/details/8844049.转载 2020-05-14 10:54:58 · 4394 阅读 · 0 评论 -
postgreSql根据多个字段去重详细流程
postgreSql根据多个字段去重详细流程这是测试表的建标语句,需要的可以拿去用。CREATE TABLE "public"."class_name" ( "id" int4 NOT NULL DEFAULT nextval('id'::regclass), "class_no" varchar(50) COLLATE "pg_catalog"."default", "name" varchar(255) COLLATE "pg_catalog"."default", "age" in原创 2020-05-10 16:00:01 · 5272 阅读 · 0 评论 -
postgresql分组查询后拼接其他字段
用一张简单的表做演示class_name表可以通过聚合函数实现,如下sql实现:select class_no,string_agg(name, ',') as names from class_name GROUP BY class_no结果如下:注意string_agg函数的两个参数必须是字符类型。如果不是,可以通过 ::VARCHAR 转换:select class_no...原创 2020-01-21 13:46:41 · 4007 阅读 · 0 评论