有count(?)的嗎  ,學習
如果是count('?')我倒見過
()里面用常量會使查詢的速度變快

解决方案 »

  1.   

    select count(?)
    from table
    where filed=x
    返回条件为filed=x结果集?的个数也就是说很简单的表名table,字段A,Bselect count(A) from table
    这句话的意思就是数一下字段A中有几行值如果表是这样的A    B1    23    23    4select count(A)from table那么count显示的一定是count3因为有3行值现在明白了没??
      

  2.   

    没明白。每一列的行数不是一样的吗?这样任何情况下不是都可以写成
    select count(*)
    from  table
    where filed = 某条件;
      

  3.   

    count()就是返回符合条件的记录数
    如:
    a  b
    1  2
    2  0
    3  0
    4  0select count(*) cou from table;
    select count(1) cou from table;
    select count(a) cou from table;
    返回:
    cou
      4
    select count(*) cou from table where b=0;
    cou
      3
      

  4.   

    你就想象成count就是一个计算器,。你想计算什么东西有几个的时候就可以用它,就这么简单。
    A    B1    23    3    
    select count(A)from table
    count3select count(B)from table
    count
    1要是还不明白我就没办法了