Skip site navigation (1) Skip section navigation (2)

Re: PostgreSQL and Bitwise and with int8 field

From: Michael Fuhr <mfuhr+pgsql-php(at)fuhr(dot)org>
To: "Seader, Cameron" <CSeader(at)idahopower(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: PostgreSQL and Bitwise and with int8 field
Date: 2003-12-21 01:52:49
Message-ID: 20031220185249.A12953@quality.qadas.com (view raw or flat)
Thread:
Lists: pgsql-php
On Sat, Dec 20, 2003 at 02:44:31PM -0700, Seader, Cameron wrote:
> I am trying to get the proper output with this SQL statement:
> 
> SELECT *, (highalarm & 0xffffffff)as high1, (highalarm >> 32)as high2 FROM t444d500009b5_2_6 ORDER BY utctime DESC LIMIT 1

Try this:

SELECT *, (highalarm & x'ffffffff'::int8) AS high1, (highalarm >> 32) AS high2
FROM t444d500009b5_2_6
ORDER BY utctime DESC
LIMIT 1

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-php by date

Next:From: Sebastiano CascioneDate: 2003-12-21 15:59:12
Subject: sql_num_rows on win32
Previous:From: Seader, CameronDate: 2003-12-20 21:44:31
Subject: PostgreSQL and Bitwise and with int8 field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group