Monday 16 July 2012

difference between count(*), count(age) and count(distinct age)

1. select count(*) from employee;
        it will select all the rows including null's.
2. select count(age) from employee;
       it will select all the rows excluding null's.
3. select count(distinct age) from employee;
      it will select all the rows excluding null's and similar rows.

No comments:

Post a Comment