SQL语法参考手册
说明: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')
上一篇:T-SQL脚本:计算表的宽度
下一篇:SQL中使用WITH AS提高性能
关注此文读者还看过



