PostgreSQL中Bit和Boolean数据类型的区别

时间:2017-09-06 10:19:35

标签: postgresql sqldatatypes

我是PostgreSQL的新手。我在数据库中创建表时有疑问。任何人都可以澄清<Button x:Name="btnSelectParent" ... Tag="{Binding Path=DataContext, RelativeSource={RelativeSource AncestorType=DataGridRowHeader}}"> <Button.ToolTip> <ToolTip> <TextBlock TextAlignment="Left" Foreground="Black" FontWeight="Normal" Text="{Binding PlacementTarget.Tag.ParentBtnMessage, RelativeSource={RelativeSource AncestorType=ToolTip}}"/> </ToolTip> </Button.ToolTip> </Button> this.handleClick = this.handleClick.bind(this); 数据类型之间的区别吗?

1 个答案:

答案 0 :(得分:6)

bit仅存储数字01(或null)。

boolean仅存储truefalse(或null)。数字(0,1)布尔值。布尔值可以在预期的布尔表达式的任何地方使用。所以你可以,例如这样做:

where is_active 

需要将位列与某些内容进行比较:

where a_bit_column = 0

a_bit_column = 0的结果是布尔值)

与某些DBMS的想法相反,表达式where 0where 1不是有效的布尔表达式。

相关问题