Subject Re: [firebird-support] Re: Firebird 2.5 (64 bit), strange SQL result
Author Thomas Steinmaurer
> --- In firebird-support@yahoogroups.com, Alexandre Benson Smith<iblist@...> wrote:
>>
>> Em 7/5/2012 21:51, trskopo escreveu:
>>> Hi all,
>>>
>>> I run sql statement via flamerobin, the statment is like this :
>>>
>>> SELECT * FROM M_INT_FRM a
>>> where a.ID_TRS_TYP = 100
>>>
>>> It will returns :
>>>
>>> ID ID_DIV_LC SCT_INI ID_TRS_TYP FRM_INI
>>> ========================================
>>> 4 8 MP 100 PO
>>> 5 9 MN 100 PO
>>> 6 0 MS 100 PO
>>>
>>>
>>> but if I change sql statement to this
>>>
>>> SELECT * FROM M_INT_FRM a
>>> where a.ID_TRS_TYP = 100
>>> and a.id_div_lc = 0
>>>
>>> no sql result returns.
>>>
>>> You can download the database at http://www.mediafire.com/?bx8k29kt7x2ucks
>>>
>>> Strange, could it be a bug?
>>>
>>> Thanks and regards,
>>> Sugiarto
>>>
>>
>> What the datatype of ID_DIV_LC column ?
>>
>> what about:
>>
>> SELECT * FROM M_INT_FRM a
>> where a.ID_TRS_TYP = 100
>> and a.id_div_lc between -0.1 and 0.1
>>
>> see you !
>>
>
> Still no result.
>
> Here is the table structure
> CREATE TABLE M_INT_FRM
> (
> ID Integer NOT NULL,
> ID_DIV_LC Integer NOT NULL,
> SCT_INI Varchar(2) NOT NULL,
> ID_TRS_TYP Integer NOT NULL,
> FRM_INI Varchar(2) NOT NULL,
> PRIMARY KEY (ID)
> );

What's the execution plan? If it's using an index on ID_DIV_LC and the
following returns a result set:

select
*
from
m_int_frm a
where
a.id_trs_typ = 100
and a.id_div_lc + 0 = 0


Then your index on ID_DIV_LC might be problematic/corrupted.


--
With regards,
Thomas Steinmaurer (^TS^)
Firebird Technology Evangelist

http://www.upscene.com/

Do you care about the future of Firebird? Join the Firebird Foundation:
http://www.firebirdsql.org/en/firebird-foundation/