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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-php by date

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