Help with sql statement

Closed
rony001 Posts 1 Registration date Wednesday August 29, 2012 Status Member Last seen September 25, 2012 - Aug 29, 2012 at 02:07 AM
Bionik Posts 4234 Registration date Thursday August 19, 2010 Status Moderator Last seen August 3, 2016 - Sep 3, 2012 at 05:05 AM
Hello,

Please help me with this

I want to list all tables in ms access database and sum of a specific column (I have a column name "total" in all tables).I found sql statement that returns list of table names but how do I get the sum of column "total" from all tables and place next to corespoding table?

I have tried so far

 select table_name from information _schema.columns where column_name="total"


any bit of info would be helpful



1 response

Bionik Posts 4234 Registration date Thursday August 19, 2010 Status Moderator Last seen August 3, 2016
Sep 3, 2012 at 05:05 AM
Greetings,

You can use this syntax for getting the sum of a specifiq table:
   SELECT SUM(colum_name) AS sum FROM table_name


This gonna return the sum of the column.

Good Luck!
1