当前位置:网站首页>Jincang database kingbasees SQL language reference manual (3.1.1.6. boolean type, 3.1.1.7. bit string type)
Jincang database kingbasees SQL language reference manual (3.1.1.6. boolean type, 3.1.1.7. bit string type)
2022-07-18 13:16:00 【Thousands of sails passed by the side of the sunken boat_】
3.1.1.6. Boolean type
grammar :BOOLEAN
KingbaseES Provide standard SQL type BOOLEAN. BOOLEAN The value is “true( really )”、“false( false )” And the third state “unknown( Unknown )”, The unknown state is determined by SQL A null value means .
data type
describe
BOOLEAN
Said really 、 Fake data type .1 Byte storage .
3.1.1.7. Bit string type
A bit string is a string 1 and 0 String of .
3.1.1.7.1. BIT type
grammar :BIT[(n)]
n It's a positive integer. , The data must match the length accurately “n“, If you store a shorter or longer bit string, an error will be reported .n default , The default is 1.
3.1.1.7.2. BIT VAYRING type
grammar :BIT VAYRING(n)
Variable length bit string , The longest is n,n It's a positive integer. . If the storage exceeds n False report .n default , Indicates that the type has no length limit .
Be careful
If we explicitly convert a bit string value to bit(n), Then its right side will be truncated or zero filled on the right , Until just ``n`` position , And will not throw any errors . Similarly , If we explicitly convert a bit string value to bit varying(n), If it exceeds ``n`` position , Then its right side will be truncated .
Please refer to Bit string constant Get information about the syntax of bit string constants . There are also some bit logic operators and string manipulation functions available , see Bit string functions and operators .
example 10-1. Use bit string type
CREATE TABLE test (a BIT(3), b BIT VARYING(5)); INSERT INTO test VALUES (B'101', B'00'); INSERT INTO test VALUES (B'10', B'101'); ERROR: bit string length 2 does not match type bit(3) INSERT INTO test VALUES (B'10'::bit(3), B'101'); SELECT * FROM test; a | b -----+----- 101 | 00 100 | 101
A bit string value for each 8 The group of bits requires a byte , Plus total 5 Or 8 Bytes , It depends on the length of the string ( But long values may be compressed or moved out of line , Such as Character type The interpretation of string in is the same ).
边栏推荐
- 论文阅读:Pyramid Scene Parsing Network
- hcip第五天笔记
- 金仓数据库 KingbaseES SQL 语言参考手册 (3.1.1.13. JSON 类型)
- 简述memcached的工作原理
- Google Earth engine app (GEE) - load a searchable Spector
- Rust iter& match
- Use of zip/enumerate/map function
- hcip第五天筆記
- hcip第二天
- Implementation of MCU stack backtracking debugging principle based on gd32 c10x
猜你喜欢

ReversingKr-wp(5)

Closing report of communication software development and Application

缩减50%调试成本 小匠物联推可远程的串口调试助手

Hcip dynamic routing experiment (RIP)

iptables 端口转发

Still reading logs on the command line? Use kibana, visual log analysis yyds~
![[golang | GRC] GRC client streaming client streaming practice](/img/03/81972027ebaa1f5f20b61e35b12ea1.png)
[golang | GRC] GRC client streaming client streaming practice

Outil de transfert de port rinetd

安装g2opy框架

变焦跟踪理论基础
随机推荐
变焦跟踪理论基础
金仓数据库 KingbaseES SQL 语言参考手册 (3.1.1.5. 大对象数据类型)
[performance test] performance test question and answer
今日份工作感悟
金仓数据库 KingbaseES SQL 语言参考手册 (3.1.1.6. 布尔类型、3.1.1.7. 位串类型)
Google Earth engine app (GEE) - load a searchable Spector
mysql中一些功能相似的函数详解
端口轉發工具 rinetd
The development of digital collection system helps enterprises' meta universe scene marketing
Where is the motivation to be a test / development programmer? How to persist
聊聊数据溢出的事
Cancel default style
花生壳内网穿透实践指南
报错解决——RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton
解决pycharm无法输入中文的方法:
Chapter 5: NoSQL database
Mysql5.7创建用户错误:ERROR 1364 (HY000): Field ‘ssl_cipher‘ doesn‘t have a default value解决方法
Briefly describe the working principle of memcached
[QT introduction] basic knowledge of programming
viewpager冲突解决