How to write integers using binary notation in presto?

by hal.littel , in category: MySQL , 6 months ago

How to write integers using binary notation in presto?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by darrion.kuhn , 6 months ago

@hal.littel 

To write integers using binary notation in Presto, you can use the following format:


For example, to write the integer 10 in binary notation, you can use the following expression:

1
SELECT TO_BINARY(10) AS binary_notation;


This will output the binary representation of the integer 10, which is 1010.

Related Threads:

How to group time column into 5 second intervals and count rows using presto?
How to write a custom window function for presto?
How to write a test for method in laravel using phpspec?
How to achieve "insert ignore" using presto?
How to query nested fields in mongodb using presto?
How to set query timeout when using presto cli?