Manjula Kutty wrote:
Hi Kathy,
Thanks for the valuable information.
--Manjula
On 1/27/06, *Kathey Marsden* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Manjula G Kutty wrote:
>
> I'm seeing a difference in behaviour of derby from version 10.1
and 10.2.
I think this difference is ok. See below
> ij> select id,date from inbox where id = true;
> ERROR 42X01: Syntax error: true.
> ij> select id from inbox where id = true;
> ERROR 42X01: Syntax error: true.
>
> This is the expected behaviour since the id colum is a bigint
>
[snip]
> But on 10.2 instead of giving me a syntax error the query returns
> rows..WHY?
>
The reason for the syntax error in 10.1 is not related to the column
being bigint. It is because the type boolean was not supported, so
specifying "where true" or "where false" was not legal. In
10.2 we
added support for this type (DERBY-499).
In a where clause you always are going to have some boolean
expression,
but in 10.1 that had to be some expression that evaluated to true or
false, so if you wanted to specify "where true", you had to choose
some expression that was always true like "where 1=1" or in this case
the less obvious "where 0<3". For false in 10.1, you might choose
"where 1=0".
I don't think "where true" adds much to to this query. "select
id from
inbox" would also return all the rows.
"delete from inbox where true" would be a much more interesting
and some
days tempting prospect.
Kathey
Hi Kathy,
Can you please clarify me ,
then why
select id,date from inbox where id = true;
ID |DATE
-----------------------------------------------
21 |2006-01-26 14:34:46.455
returns one row and
ij> select id,date from inbox where id = 0<3;
returns all rows in the table???
I think I'm confused now.
Thanks
Manjula