how count number of rows in myquery table code example
Example 1: mysql count table rows
select table_name, sum(table_rows) as sum
from information_schema.tables
where table_schema = '[DB NAME]'
group by table_name
order by sum desc;
Example 2: query to count the number of rows in a table in sqlalchemy
UserImage.query.filter(UserImage.user_id == 1).count()