我不知道能不能在  WHERE  中用  CASE  语句
如果能用请举个例子,谢谢各位了

解决方案 »

  1.   

    不能吧,我沒歲過,我只知道在在select 後可以用?
      

  2.   

    不能吧,用and和or 根定可以达到同样的效果
      

  3.   

    select * from where sex=(case when 男 then 1 else 0 end)
      

  4.   

    Dim r As New ADODB.Recordset
    Set r = Data.rsadmin
    r.Open
    If Text1.Text = "" Or Text1.Text <> r("password") Then
        MsgBox "Your password is wrong ", vbQuestion, "error"
        Else
        If Text2.Text = "" Or Text3.Text = "" Or Text2.Text <> Text3.Text Then
          MsgBox "your new password is not correct ", vbQuestion, "error"
          Else
            While Not r.EOF
             Data.Con.Execute "update admin set password='" & Text3.Text & "'"
             r.MoveNext
            Wend
        End If
    End If
    r.Close
    Set r = Nothing
    这个SQL语句有问题吗?(Data.Con.Execute "update admin set password='" & Text3.Text & "'")