By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

Retrieve number of rows in table

P: 2
I am newbie in Postgre, and i must write function that retrieve number of rows in given table. How it can be done?

Thanks preliminary

Dimitar Smilyanov
May 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
Hi, you can use the following sentence

Expand|Select|Wrap|Line Numbers
  1. SELECT COUNT (*) FROM tablename;
I hope this can help you.
May 11 '07 #2

Expert 100+
P: 534
Hi, you can use the following sentence
Expand|Select|Wrap|Line Numbers
  1. SELECT COUNT (*) FROM tablename;
I hope this can help you.
Normally that's all you need to get the row count; if you really need to put this code n a function look at these links:

http://www.postgresql.org/docs/8.0/s...efunction.html
http://www.postgresql.org/docs/8.0/s...xfunc-sql.html
May 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.