Discussions

Expand all | Collapse all

Count value is showing correct Value

  • 1.  Count value is showing correct Value

    Posted 08-30-2019 09:37
    Edited by Sumit Srivastava 08-30-2019 09:38
    Hi team,

    Doing some lab testing and observed that count is not showing correct value when dividing the value by a million.

    omnisql> select count(*) from AGGREGATE;
    EXPR$0
    8272078980

    omnisql> select count(*)/1000000 from AGGREGATE;
    EXPR$0
    -317
    omnisql>
    #Core

    Typo Error in subject--- In place of incorrect value mentioned correct


  • 2.  RE: Count value is showing correct Value

    Posted 08-30-2019 13:15
    Hi @Sumit Srivastava

    To get correct results on such big counts, you have to turn on the parameter -count=true.

    omnisql> select count() from test_3b;
    EXPR$0
    3088374125
    omnisql> select count()/1000000 from test_3b;
    EXPR$0
    3088
    ​

    If you need values you have to do an explicit cast

    omnisql> select cast(count() as decimal(19,8))/1000000 from test_8b;
    EXPR$0
    3088.37412500
    ​