请帮我解释一下用法,谢谢.

解决方案 »

  1.   

    count() 是做统计用的
    比如
    select count(*) from tab1
    能统计出tab1的所有行 就是总共用多少数据还能指定统计 select count(tabs) from tab1 where tabs=22通常count和 distinct  连用
      

  2.   

    count估计是最简单的函数了,lz直接哪一个有数据的表,测试去,可以直接select count(1) from table_name.也可以后面加count的条件,如
    select count(1) from table_name where filed1=....
      

  3.   

        COUNT 
     
    SYNTAX: 
        COUNT({* | [DISTINCT|ALL] expr}) 
     
    PURPOSE: 
        Returns the number of rows in the query. 
     
        If you specify expr, this function returns rows where expr is not 
        null.  You can count either all rows, or only distinct values of 
        expr. 
     
        If you specify the asterisk (*), this function returns all rows, 
        including duplicates and nulls. 
     
    EXAMPLES: 
     
        SELECT COUNT(*) "Total" 
            FROM emp 
     
        Total 
        ----- 
           14 
     
        SELECT COUNT(job) "Count" 
            FROM emp 
     
        Count 
        ----- 
           14 
     
        SELECT COUNT(DISTINCT job) "Jobs" 
            FROM emp 
     
        Jobs 
        ---- 
           5 
      

  4.   


    这种问题,随便一本初级书都有,随便Google一下都有...
    有问题,先尝试自己去找答案,实在不明白再来问人...
    如果碰到不知道的就去问,永远没有成长.