1. IN 後面接的是一个集合,表示column1 存在集合里面。
2. Select 出来的资料形态必须符合 column1。
其他查询
Select *
FROM table_name1
Where column1 LIKE 'x%'
说明:LIKE 必须和後面的'x%' 相呼应表示以 x为开头的字串。
Select *
FROM table_name1
Where column1 IN ('xxx','yyy',..)
说明:IN 後面接的是一个集合,表示column1 存在集合里面。
Select *
FROM table_name1
Where column1 BETWEEN xx AND yy
说明:BETWEEN 表示 column1 的值介於 xx 和 yy 之间。
3、更改资料:
Update table_name
SET column1='xxx'
Where conditoins
说明:
1.更改某个栏位设定其值为'xxx'。
2.conditions 是所要符合的条件、若没有 Where 则整个 table 的那个栏位都会全部被更改。
4、删除资料:
Delete FROM table_name
Where conditions
说明:删除符合条件的资料。
说明:关于Where条件后面如果包含有日期的比较,不同数据库有不同的表达式。具体如下:
(1)如果是ACCESS数据库,则为:Where mydate〉#2000-01-01#
(2)如果是ORACLE数据库,则为:Where mydate〉cast('2000-01-01' as date)
或:Where mydate〉to_date('2000-01-01','yyyy-mm-dd')
在Delphi中写成:
thedate='2000-01-01';
query1.SQL.add('select * from abc where mydate〉cast('+''''+thedate+''''+' as date)');
如果比较日期时间型,则为:
Where mydatetime〉to_date('2000-01-01 10:00:01','yyyy-mm-dd hh24:mi:ss')
Recordset对象一些有用的属性"/〉 引用来自 增加一个 :Recordset对象一些有用的属性
rs.CursorType=
rs.CursorLocation=
rs.LockType =
rs.CacheSize=
rs.Pagesize=
rs.Pagecount=
rs.RecordCount=
''---- CursorType Values ----
Const adOpenForwardOnly = 0 仅向前
Const adOpenKeyset = 1 键集游标
Const adOpenDynamic = 2 动态游标
Const adOpenStatic = 3 静态游标
''---- LockType Values ----
Const adLockReadOnly = 1 默认值,只读
Const adLockPessimistic = 2 保守式记录锁定










