16.20 - Example: Querying with the GETBIT Function - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Functions, Expressions, and Predicates

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

The following query gets the value of the third bit of the input argument 23, which has a data type of BYTEINT and a binary representation of 00010111. The query result is a BYTEINT value of 1 or binary 00000001.

   SELECT GETBIT(23,2);