Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ain6C-0007FV-Cn for pgsql-sql@arkaria.postgresql.org; Wed, 23 Mar 2016 18:01:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ain6B-00089L-V3 for pgsql-sql@arkaria.postgresql.org; Wed, 23 Mar 2016 18:01:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ain5E-0006fg-Fh for pgsql-sql@postgresql.org; Wed, 23 Mar 2016 18:00:40 +0000 Received: from oldperseverance.encs.concordia.ca ([132.205.96.92]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ain5B-0006lI-Pn for pgsql-sql@postgresql.org; Wed, 23 Mar 2016 18:00:39 +0000 Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id u2NI0ap1029362 for ; Wed, 23 Mar 2016 14:00:36 -0400 Reply-To: emilu@encs.concordia.ca To: pgsql-sql@postgresql.org From: Emi Subject: query based on row number for psql8.3 Message-ID: <56F2D9C4.9010304@encs.concordia.ca> Date: Wed, 23 Mar 2016 14:00:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2016-03-23 14:00:36 EDT X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org 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