How do i know the count of rows in a database through a query

Hi All,

I have a database with millions of records, i want to fetch some based on a condition. Before i try to fetch all the rows, i want to know the number of rows. Can someone tell how this can be done as i tried
select count(*) in the db table selector but it didn’t work.

Hi @r_jain

Which DB type are you quering?
Which KNIME node are you using?
In what way does it not work? Which error message do you get?
Do you have a WF or some screenshots?

I think i figured it out. I used DB query reader which gave me the count once i perform evaluate.
I am using impala database and trying to fetch in from a view.

Thanks for responding. :slight_smile:

What you can also do is the following:

use a DB Table Selector to select the table, than use the Group By to do the count (there is a checkbox at the button). And finally use the DB Reader to get the count.

This way you can very easily extend this and reuse parts of it. Without always reexecuting everything in the database.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.