Skip site navigation
(1)
Skip section navigation
(2)
Search
Peripheral Links
Text Size:
Normal
/
Large
Donate
Contact
Header And Logo
|
Site Navigation
Home
About
Downloads
Documentation
Community
Developers
Support
Section Navigation
Community
Contributors
Mailing Lists
Subscribe
User lists
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-bugs
pgsql-docs
pgsql-cygwin
pgsql-general
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql -performance
pgsql-php
pgsql-ports
pgsql-sql
Developer lists
Regional lists
Project lists
User groups
Inactive lists
IRC
Featured Users
International Sites
Propaganda
Resources
Weekly News
Community login
Profile
Lost password
Search for
Advanced Search
Re: a JOIN on same table, but 'slided over'
From
: "hubert depesz lubaczewski" <
depesz(at)gmail(dot)com
>
To
: "Rafal Pietrak" <
rafal(at)zorro(dot)isa-geek(dot)com
>
Cc
:
pgsql-general(at)postgresql(dot)org
Subject
: Re: a JOIN on same table, but 'slided over'
Date
: Tue, 26 Jun 2007 10:06:43 +0200
On 6/26/07,
Rafal Pietrak
<
rafal(at)zorro(dot)isa-geek(dot)com
> wrote:
Is there an SQL construct to get it?
select
distinct on (
t1.id
)
t1.*, t2.*
from
test t1
join test t2 on
t2.id
>
t1.id
order by
t1.id
asc,
t2.id
asc
should do the trick.
depesz
--
http://www.depesz.com/
- nowy, lepszy depesz
Follow-Ups
:
Re: a JOIN on same table, but 'slided over'
From:
Rafal Pietrak
References
:
a JOIN on same table, but 'slided over'
From:
Rafal Pietrak
Prev by Date:
a JOIN on same table, but 'slided over'
Next by Date:
Re: data partitions across different nodes
Previous by thread:
a JOIN on same table, but 'slided over'
Next by thread:
Re: a JOIN on same table, but 'slided over'
Indexes:
Main
Thread
Home
|
Main Index
|
Thread Index
Privacy Policy
| PostgreSQL Archives hosted by
Command Prompt, Inc.
| Designed by
tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group