1. COUNT(*) returns the number of rows that match the search conditions specified in the query without eliminating duplicates.
SELECT COUNT(*)
FROM titles
2.COUNT(*) can be combined with other aggregate functions.SELECT COUNT(*), AVG(price)
FROM titles
WHERE advance > $1000SELECT COUNT(DISTINCT city)
FROM authorsRemark:
COUNT(*) returns the number of items in a group, including NULL values and duplicates.
COUNT(ALL expression) evaluates expression for each row in a group and returns the number of nonnull values.
COUNT(DISTINCT expression) evaluates expression for each row in a group and returns the number of unique, nonnull values.
No comments:
Post a Comment