Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 929 Bytes

File metadata and controls

42 lines (30 loc) · 929 Bytes
description
Returns the bitwise AND of non-NULL input values.

BIT_AND

Syntax

BIT_AND(expression int) → int

  • expression: An expression that evaluates to a data type that can be cast as an integer.

Examples

{% code title="BIT_AND example" %}

SELECT BIT_AND(transaction_count)
  FROM eth.recent_blocks 

-- EXPR$0
-- 0

{% endcode %}

{% code title="BIT_AND example" %}

SELECT total_gas_used, 
  BIT_AND(transaction_count)
FROM eth.recent_blocks 
GROUP BY total_gas_used

-- total_gas_used, EXPR$1
-- 21.5, 0
-- 19.1, 0

{% endcode %}

Usage Notes

If no rows match, returns a value with all bits set to 1. NULL values have no effect on the result unless all results are NULL, which is treated as no match.

\