对于 select distinct on , 可以利用下面的例子来理解:
create table a6(id integer, name varchar(10));
insert into a6 values(1, ' 001');
insert into a6 values(1, '002');
insert into a6 values(2, '003');
insert into a6 values(2, '004');
select distinct on (id) id, name from a6;
id | name
---+--------
1 | 001
2 | 003
(2 rows)
 类似于窗口函数row_number
 
 
 

http://blog.csdn.net/luojinbai/article/details/45078809

postgresql-distinct on理解的更多相关文章

  1. 对PostgreSQL xmax的理解

    xmax The identity (transaction ID) of the deleting transaction, or zero for an undeleted row version ...

  2. 腾讯云数据库团队:PostgreSQL TOAST技术理解

    作者介绍:胡彬 腾讯云高级工程师 TOAST是"The Oversized-Attribute Storage Technique"的缩写,主要用于存储一个大字段的值.要理解TOA ...

  3. 关于linux上postgresql的一些理解

    刚开始接触postgresql,安装后就有一个默认用户postgres,而且在启动postgresql后只能通过切换到linux的postgres用户才能登录数据库进行操作,和Mysql的登录认证居然 ...

  4. PostgreSQL DISTINCT 和 DISTINCT ON

    select语句中,使用distinct关键字,在处理select list后,结果表可以选择消除重复的行.在SELECT之后直接写入DISTINCT关键字以指定此关键字: SELECT DISTIN ...

  5. PostgreSQL DISTINCT ON

    https://stackoverflow.com/questions/3800551/select-first-row-in-each-group-by-group select DISTINCT ...

  6. PostgreSQL相关的软件,库,工具和资源集合

    PostgreSQL相关的软件,库,工具和资源集合. 备份 wal-e - Simple Continuous Archiving for Postgres to S3, Azure, or Swif ...

  7. PostgreSQL安装详细步骤(windows)

    原文地址:http://blog.chinaunix.net/uid-354915-id-3498734.html PostgreSQL安装:一.windows下安装过程安装介质:postgresql ...

  8. PostgreSQL安装详细步骤windows

    PostgreSQL安装:一.windows下安装过程安装介质:postgresql-9.1.3-1-windows.exe(46M),安装过程非常简单,过程如下:1.开始安装: 2.选择程序安装目录 ...

  9. PostgreSQL安装详细步骤(windows)[转]

    PostgreSQL安装: 一.windows下安装过程 安装介质:postgresql-9.1.3-1-windows.exe(46M),安装过程非常简单,过程如下: 1.开始安装: 2.选择程序安 ...

  10. 2.PostgreSQL安装详细步骤(windows)【转】

    感谢 Junn9527 PostgreSQL安装:一.windows下安装过程安装介质:postgresql-9.1.3-1-windows.exe(46M),安装过程非常简单,过程如下:1.开始安装 ...

随机推荐

  1. mysql之零碎知识

    一 视图 什么是视图:视图就是一张虚拟表.方便查看. 创建视图:create view 起名 as sql语句 #两张有关系的表 mysql> select * from course; +-- ...

  2. Codeforces Round #514 (Div. 2) E. Split the Tree(倍增+贪心)

    https://codeforces.com/contest/1059/problem/E 题意 给出一棵树,每个点都有一个权值,要求你找出最少条链,保证每个点都属于一条链,而且每条链不超过L个点 和 ...

  3. mysql学习之路_外键

    回顾4 连接查询: 连接多张表到一起,不管记录数如何,字段数一定会增加. 分类:内连接,外连接.自然连接,交叉连接, 交叉连接:cross join (笛卡尔积) 内连接:inner join,左右两 ...

  4. PHP发起POST DELETE GET POST 请求

    原文链接:http://blog.csdn.net/lengxue789/article/details/8254667 关于POST,DELETE,GET,POST请求 get:是用来取得数据.其要 ...

  5. Ng第九课:神经网络的学习(Neural Networks: Learning)

    9.1  代价函数 9.2  反向传播算法 9.3  反向传播算法的直观理解 9.4  实现注意:展开参数 9.5  梯度检验 9.6  随机初始化 9.7  综合起来 9.8  自主驾驶 9.1   ...

  6. Update Node.js Package.json

    Update the latest package while using node.js, follow the command as following. npm i -g npm-check-u ...

  7. Jack Straws(poj 1127) 两直线是否相交模板

    http://poj.org/problem?id=1127   Description In the game of Jack Straws, a number of plastic or wood ...

  8. POJ3104--Drying(Binary Search)

    It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She ...

  9. 【python3+request】python3+requests接口自动化测试框架实例详解教程

    转自:https://my.oschina.net/u/3041656/blog/820023 [python3+request]python3+requests接口自动化测试框架实例详解教程 前段时 ...

  10. android textview支持多种格式跳转

    http://www.linuxidc.com/Linux/2011-08/40530p2.htm 1.android:autoLink属性,使TextView中链接手机号码/网页/邮件/地图 and ...