一表log 中有username 和 logon 两个字段,怎样求一个用户登录的次数.也就是表中username出现的次数.

解决方案 »

  1.   

    select Count(username) from Table where username = 'UserName'
      

  2.   

    select count(username) from log where username=''
      

  3.   

    select Count(username) from log where username = 'UserName' and logon='true'
      

  4.   

    select Count(username) from log where username = '用户名'
    还有就是不知道楼主的表中 logon  起什么作用啊。如果也要根据logon查询,以上
    语句就需要修改。
      

  5.   

    select Count(username) from log where username = '用户名'
    或者select countlog from (
    select username, count(username) countlog from log group by username)
    where  username = '用户名'
      

  6.   

    select Count(username) from log where username = '用户名'