Re: PostgreSQL and Bitwise and with int8 field - Mailing list pgsql-php

From Michael Fuhr
Subject Re: PostgreSQL and Bitwise and with int8 field
Date
Msg-id 20031220185249.A12953@quality.qadas.com
Whole thread Raw
In response to PostgreSQL and Bitwise and with int8 field  ("Seader, Cameron" <CSeader@idahopower.com>)
List 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
LIMIT1 

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/

pgsql-php by date:

Previous
From: "Seader, Cameron"
Date:
Subject: PostgreSQL and Bitwise and with int8 field
Next
From: "Sebastiano Cascione"
Date:
Subject: sql_num_rows on win32