SQLite Forum

conversion of literal values, or lack thereof
Login
In the following example, the literal value <code>'1'</code> is not converted
to a numeric value in the first case, but in the second and third cases, it is:

<code><verbatim>
create table t1(c1 integer)
; insert into t1(c1) values (1)

;select 1 = '1'
, cast(1 as numeric) = '1'
, (select c1 from t1 where c1 = 1) = '1'
</verbatim></code>

Output:

<code><verbatim>
0 1 1
</verbatim></code>

Why not make that more consistent by converting in the first case as well?