pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: daq <daq@ugyvitelszolgaltato.hu>
To: pawel@deso.pl
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL query
Date: Wed, 4 Feb 2004 08:43:00 +0100
Message-ID: <19964409273.20040204084300@ugyvitelszolgaltato.hu> (raw)
In-Reply-To: <bce5a17a.0402020710.4040123a@posting.google.com>
References: <bce5a17a.0402020710.4040123a@posting.google.com>

PC> Hello,

PC> I would like to retrieve all the records from table A which have given
PC> lang_id and its modification date is later then modification date of
PC> the same id record with lang_id='pl'.

PC> Example:

PC> table A - data example
PC> ======================
PC> id      | modification_date   | lang_id
PC> --------+---------------------+------
PC> abc     | 2002-10-11 10:12:11 | en
PC> abc     | 2002-11-12 11:12:11 | pl
PC> abc     | 2002-11-11 18:12:00 | de
PC> sample  | 2003-04-15 22:43:14 | pl
PC> sample  | 2003-05-16 11:10:15 | en
PC> sample  | 2003-11-11 18:11:10 | de

select * from a where lang_id='en' and modification_date>(select
modification_date from a as a_alias where a_alias.id=a.id and
a_alias.lang_id='pl')

Try this!

DAQ




view thread (18+ messages)  latest in thread

Message-ID: <19964409273.20040204084300@ugyvitelszolgaltato.hu>
Permalink:  ../19964409273.20040204084300@ugyvitelszolgaltato.hu/
Also on:    postgresql.org/message-id/19964409273.20040204084300@ugyvitelszolgaltato.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: daq@ugyvitelszolgaltato.hu, pawel@deso.pl
  Subject: Re: SQL query
  In-Reply-To: <19964409273.20040204084300@ugyvitelszolgaltato.hu>
  References: <bce5a17a.0402020710.4040123a@posting.google.com> <19964409273.20040204084300@ugyvitelszolgaltato.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox