Re: SQL Syntax - like FIELD and BITPATTERN = BITPATTERN?

Поиск
Список
Период
Сортировка
От Harvey, Allan AC
Тема Re: SQL Syntax - like FIELD and BITPATTERN = BITPATTERN?
Дата
Msg-id E97A5BB7699CAD48BE2711E7124711650601ADDA@ntlmsg03.onesteel.com
обсуждение исходный текст
Ответ на SQL Syntax - like FIELD and BITPATTERN = BITPATTERN?  (Ozz Nixon <ozznixon@gmail.com>)
Список pgsql-general
> I do not know how to really describe this...
>
> In pascal I would do
>
>         If (AField and Flag3)=Flag3 then ...
>
> Checking to see if AField contains the BIT(s) FLAG3 is set to... is
> there a way to do this in a SELECT statement -- select * from ATable
> where AField and 0x0004=0x0004
>
> ?
>
> Thanks,
> O.
>
perhaps select * from ATable where AField::bit(16) & B'000000000100' = B'0000000000000100';

Allan


The material contained in this email may be confidential, privileged or copyrighted. If you are not the intended
recipient,use, disclosure or copying of this information is prohibited. If you have received this document in error,
pleaseadvise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses
containedin this email or any attachments. 

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Fischer
Дата:
Сообщение: Re: Trigger help - updates to column data with null values
Следующее
От: Ben Eliott
Дата:
Сообщение: Fwd: createdb but revoke dropdb