Developer blog

Saturday, July 23, 2005

Postgresql issue

Working with MySQL about two years already, I believed that if you what to count all fields in some table, you should do something like this

SELECT count(*) FROM table_name


But yesteday I found out that it does not work for Postgresql. It often backs you error, something about group by. So solution is to do it in this way

SELECT DISTINCT count(*) FROM table_name

0 Comments:

Post a Comment

<< Home