-1

I've tried using pragma table_info(test001) however that just returns another table where there's a row for every column. My issue is that, how do I count the rows? I've tried using

SELECT COUNT(*) FROM PRAGMA table_info(test001)
and
SELECT COUNT(CID) FROM PRAGMA table_info(test001)

However they both error out. Does anyone know how I could get an actual numerical value using PRAGMA? I read the documentation for table_info but it didn't help in figuring out how to actual get a value from it.

slam505
  • 13
  • 8

1 Answers1

1

You can do this:

select count(*) from pragma_table_info('tablename');

You can find more info here: https://www.sqlite.org/pragma.html in the section PRAGMA functions

g_bor
  • 1,077
  • 6
  • 14
  • I feel like an absolute buffoon. I looked at the link prior to posting the question but I just didn't know that the only thing I was missing was an underscore between PRAGMA and table_info... – slam505 Sep 17 '20 at 19:13