How to write integers using binary notation in presto?

by hal.littel , in category: MySQL , 14 days ago

How to write integers using binary notation in presto?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by darrion.kuhn , 14 days 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.