On 28-2-2019 02:02, Robert Tulloch tult...@hughes.net [firebird-support] 
wrote:
> Hi:
> 
>    I just ran this
> 
> select 'MEMPAY1' AS TABLE_NAME, 'M1ID' AS INDEX_NAME, 
> cast(RDB$STATISTICS as varchar(32)) as RDB$STATISTICS from rdb$indices 
> where RDB$SYSTEM_FLAG is null
> or RDB$SYSTEM_FLAG = 0 order by RDB$STATISTICS
> 
> And it returned 76 "records" all the same table and index but with 
> different values for RDB$STATISTICS
> 
> ranging from  0.0001628664467716590  to  1.000000000000000
> 
> Over my head. How can there be 76 different values?

select 'MEMPAY1' AS TABLE_NAME

This means: use the literal value 'MEMPAY1' under the column name 
TABLE_NAME and output it for each row (and similar for INDEX_NAME). In 
other words, no matter the content, each row will have the value 'MEMPAY1'.

If you want to filter on table and index name, you need to add a 
condition in the WHERE clause, so:

where RDB$RELATION_NAME = 'MEMPAY1'
and RDB$INDEX_NAME = 'M1ID1'
and (RDB$SYSTEM_FLAG is null or RDB$SYSTEM_FLAG = 0)

Mark
-- 
Mark Rotteveel

Reply via email to