Discussions

Expand all | Collapse all

Count value is showing correct Value

  • 1.  Count value is showing correct Value

    Posted 20 days ago
    Edited by Sumit Srivastava 20 days ago
    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 19 days ago
    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
    ​