SELECT 1='1'给人
TRUE因为
'1'是一个正确的构造函数
INT中知道我所有的实现。
但是SQL使用严格的类型,请注意:
# SELECT 1=CAST('1' AS TEXT);ERROR: operator does not exist: integer = textLINE 1: SELECT 1=CAST('1' AS TEXT); ^HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
关于标准(SQL 92、99和2003),这似乎是错误的:
<literal> ::= <signed numeric literal> | <general literal> <general literal> ::= <character string literal> | <national character string literal> | <bit string literal> | <hex string literal> | <datetime literal> | <interval literal> <signed numeric literal> ::= [ <sign> ] <unsigned numeric literal> <unsigned numeric literal> ::= <exact numeric literal> | <approximate numeric literal> <exact numeric literal> ::= <unsigned integer> [ <period> [ <unsigned integer> ] ] | <period> <unsigned integer> <unsigned integer> ::= <digit>... <character string literal> ::= [ <introducer><character set specification> ] <quote> [ <character representation>... ] <quote> [ { <separator>... <quote> [ <character representation>... ] <quote> }... ]
因为
<quote>仅包含在
<bit string literal>,,
<hex string literal>…中,但不包含在数字文字中。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)