Discussions

Expand all | Collapse all

how to get total count value

  • 1.  how to get total count value

    Posted 15 days ago
    how to get total count value of data after quering
    ex :
    select column from table limit 10
    it will give 10 records but if it has more than 10 records foe example if it has 100 i need total records as 100 how to i get this
    #Core


  • 2.  RE: how to get total count value

    Posted 14 days ago
    Are you looking to have the total as part of the same query in the table? The reason I ask is that you could do another query after you run the first one, but that doesn't quite sound like what you're after.


  • 3.  RE: how to get total count value

    Posted 13 days ago
    hi @Nagulan Santhi,

    it's a bit tricky, but you can achieve with a query like that (I'm adding a filter to add some spice to your query)

    with as (select count() as the_count from where f1=100)
    select t.*,the_count from table t cross join total where t.f1=100 limit 100;

    this way you will have in the column called the_count the total number of records you have to page  in your application (I guess you want to give to your users an idea about how many records they could see)