Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ainU9-0008OU-9Z for pgsql-sql@arkaria.postgresql.org; Wed, 23 Mar 2016 18:26:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ainU8-0003tF-Qw for pgsql-sql@arkaria.postgresql.org; Wed, 23 Mar 2016 18:26:24 +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 1ainU8-0003sX-0x for pgsql-sql@postgresql.org; Wed, 23 Mar 2016 18:26:24 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ainU5-0007Hl-PP for pgsql-sql@postgresql.org; Wed, 23 Mar 2016 18:26:22 +0000 Received: by mail-pf0-x22a.google.com with SMTP id 4so36914267pfd.0 for ; Wed, 23 Mar 2016 11:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=5CX2KpziN67Hkp8K2GZzAlJMHf/i0zKJ1s1PdDUB+0M=; b=FsSJxua31GpiocmvrRoi4UMFrI0sdWi0ku5jPrw0PQmZiMuRxQVxwUGuJuA9bqVujO jnrBMRS4ECE5AaM2mE+sGqhaw7MbWv49XO5hZg9kcE6YxTbsP+Oz+ZkHnSB7Dqu9uGbU 3wtsN961tM+8RSf2IBoNoiBN9xb8LbbjrvPH0mRoHHut2WVaingi4tdSdTpGXHMCJcZk PJEecLtMthexy7O4J3JKT8aWfXrZe7WsyuUjprs7DEr6JnN2sV9m9ExYLxKL9RSTtXov mY8+t4GtYykqeHvJ+3cZYP1iOphBQG2CylIC1CC8VOh25S7naSg2bpknd2hF1eXcULwj 38Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=5CX2KpziN67Hkp8K2GZzAlJMHf/i0zKJ1s1PdDUB+0M=; b=Rbvt5lKdneJd7DbiF9WbU1VEuLfOt922u4TZFAe36E2FV9+INulkeF5ABWxNkPVuLW dEVlzTOQfhBT8tPRiYCCNj6caBKQjpquWeiixco8MKF5M0525fiNGX/PpHKwdubbyHUE yqiqmMbV/nunUATARytJTKWMIQMP2UGvDURNbkeKk95WMfxLVuMgHIvb+37hJRD1MXZe 9cG2L3nMGkFkRcUMuE7xX4LhdbQ5trW5731etNLrRbb13LVmb6Z4h55LmcJdTw6jreCP SzBA98GlW2C1Td5dkUWUUFDlK0CG/xibxNfxYWpx+E7iq7lIQ7zOoNYBlIM4Mysx8J4F jXIg== X-Gm-Message-State: AD7BkJIF0yQyZZfEEkFlattRDKdFvAwUHNAofU7BZ7TKRNVKv4gypS+YL4hTPBQ0zHB1VQ== X-Received: by 10.98.70.27 with SMTP id t27mr6203357pfa.107.1458757580519; Wed, 23 Mar 2016 11:26:20 -0700 (PDT) Received: from [155.100.214.120] ([155.100.214.120]) by smtp.gmail.com with ESMTPSA id e87sm5734537pfb.76.2016.03.23.11.26.19 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2016 11:26:19 -0700 (PDT) Subject: Re: query based on row number for psql8.3 To: pgsql-sql@postgresql.org References: <56F2D9C4.9010304@encs.concordia.ca> From: Rob Sargent Message-ID: <56F2DFDC.2020408@gmail.com> Date: Wed, 23 Mar 2016 12:26:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56F2D9C4.9010304@encs.concordia.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) 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 On 03/23/2016 12:00 PM, Emi wrote: > 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 ; > > > > > I seem to recall other posts from condordia: Someone needs to take of their skates and update postgres! -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql