備忘録 - ビット演算 / FAQ Tweet
備忘録
ビット演算こんな感じでできるはず。
orcl@SCOTT> r
1 SELECT
2 d1
3 ,d2
4 ,x1
5 ,x2
6 ,UTL_RAW.BIT_OR(x1,x2) AS x1_bitor_x2
7 FROM
8 (
9 SELECT
10 POWER(2, 1) AS d1
11 , HEXTORAW(TO_CHAR(POWER(2, 1), 'FM0000000X')) AS x1
12 , POWER(2, 3) AS d2
13 , HEXTORAW(TO_CHAR(POWER(2, 3), 'FM0000000X')) AS x2
14 FROM
15 dual
16* )
D1 D2 X1 X2 X1_BITOR_X2
---------- ---------- ---------- ---------- -----------
2 8 00000002 00000008 0000000A
orcl@SCOTT>
Oracle Database 12cリリース2 PL/SQL Packages and Types Reference 270.3.3 BIT_ORファンクション
Oracle Database 12c Release 2 SQL Language Reference 7.90 HEXTORAW
Oracle Database 12c Release 2 SQL Language Reference 7.159 POWER
Oracle Database 12c Release 2 SQL Language Reference 7.237 TO_CHAR (number)
Oracle Database 12c Release 2 SQL Language Reference 2.4 Format Models 2.4.1 Number Format Models
Oracle Database 12c Release 2 SQL Language Reference 2.4 Format Models FM
| 固定リンク | 0
コメント