select isnull(sum(case when password='input_password' then 2 else 1 end),0) as OKfrom userid='input_userid'OK=0 用户名不存在OK=1 密码错误OK=2 验证成功