请问大家,SQL语句的Where子句中要是想按照某个字段不等于某个值查询,不等于号怎么写?

intersun 2002-07-29 03:46:24
请问大家,SQL语句的Where子句中要是想按照某个字段不等于某个值查询,不等于号怎么写?
...全文
2292 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
kmcyz 2002-07-29
  • 打赏
  • 举报
回复
或Set rst = dbs.OpenRecordset("SELECT LastName, " _
& "FirstName FROM Employees " _
& "WHERE LastName <> 'King';")
kmcyz 2002-07-29
  • 打赏
  • 举报
回复
一个例子:

Dim dbs As Database, rst As Recordset

' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("Northwind.mdb")

' Select records from the Employees table where the
' last name is King.
Set rst = dbs.OpenRecordset("SELECT LastName, " _
& "FirstName FROM Employees " _
& "WHERE LastName = 'King';")

' Populate the Recordset.
rst.MoveLast

' Call EnumFields to print the contents of the
' Recordset.
EnumFields rst, 12

dbs.Close
SarahCla 2002-07-29
  • 打赏
  • 举报
回复
<>
Ranma_True 2002-07-29
  • 打赏
  • 举报
回复
<>
BenBenBoy 2002-07-29
  • 打赏
  • 举报
回复
!=, <, >, <=, >=

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧