In MySQL:
  
the supported builtin bit functions and operators are: BIT_COUNT, &, |, ^, ~, 
<< and >> 
 
the supported builtin bit aggregations are: BIT_AND, BIT_OR and BIT_XOR
  
For example:
 MySQL(localhost:3306) > select 1 ^ 2; +-------+ | 1 ^ 2 | +-------+ |     3 | 
+-------+ 1 row in set (0.01 sec) MySQL(localhost:3306) > select bit_or(a), b 
from t group by b; +-----------+------+ | bit_or(a) | b    | 
+-----------+------+ |         3 |    1 | |         3 |    2 | 
+-----------+------+ 2 rows in set (0.00 sec)  
See the following links for more details:
  
https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html
 
https://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html
  ?6?7











------------------ ???????? ------------------
??????: "Julian Hyde"<[email protected]>; 
????????: 2018??6??10??(??????) ????12:31
??????: "dev"<[email protected]>; 
????: Re: calcite support bit operation



PS Can you see what support for bit operations is in other databases? It would 
be quite straightforward to add new functions, less easy to add ??&?? or ??|?? 
or ??~??.

> On Jun 9, 2018, at 6:47 PM, Julian Hyde <[email protected]> wrote:
> 
> BIt operations are not standard SQL.
> 
> Are there any databases that support them? (I??m guessing MySQL, which at one 
> point seemed to have a mission to convert SQL into C, even down to using int 
> instead of boolean.)
> 
> We could perhaps add support for bit operations, but I would not like to add 
> an ??&?? operator. It would be too disruptive to the parser. Maybe it could 
> go into Babel.
> 
> Julian
> 
>> On Jun 9, 2018, at 5:38 PM, 18390992640 <[email protected]> wrote:
>> 
>> Hello EveryOne ??
>>     I have seed calcite SqlKind.java source code, find that it hasn't bit 
>> operation.  so I want to ask why calcite don't support bit operation. for 
>> example, follow Query statement, it not support.
>>     select col_a, col_b from table_1 where (col_a & col_b) > 10.
>>       if I want to   extend calcite to supoort bit operation, how difficulty 
>> may be??
>>        who knwo this, please give me a help.  thanks very mush!
>

Reply via email to