agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Emi <emilu@encs.concordia.ca>
To: pgsql-sql@postgresql.org
Subject: query based on row number for psql8.3
Date: Wed, 23 Mar 2016 14:00:36 -0400
Message-ID: <56F2D9C4.9010304@encs.concordia.ca> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Hello,

For psql8.3, is there a simple way to query based on row number please?

For example,

select  case
                     when row_num=1 THEN    t1.tot_hr
                     ELSE                                  t1.tot_hr - 
t1.pre_hr
           END
FROM  t1 ;





-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (10+ messages)  latest in thread

Message-ID: <56F2D9C4.9010304@encs.concordia.ca>
Permalink:  ../56F2D9C4.9010304@encs.concordia.ca/
Also on:    postgresql.org/message-id/56F2D9C4.9010304@encs.concordia.ca

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: emilu@encs.concordia.ca
  Subject: Re: query based on row number for psql8.3
  In-Reply-To: <56F2D9C4.9010304@encs.concordia.ca>

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

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