有同事给了一条sql:
select count(name) from table where create_time
一般我都直接用count(*), 看到count(name),特意查了一下count的文档。
COUNT({ * | [ DISTINCT | ALL ] expr }) [ OVER (analytic_clause) ]
If you specify expr, then COUNT returns the number of rows where expr is not null. You can count either all rows, or only distinct values of expr.If you specify the asterisk (*), then this function returns all rows, including duplicates and nulls. COUNT never returns null.
count函数,虽然很常用,但以前没注意过这个,mark之。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23650854/viewspace-687035/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23650854/viewspace-687035/