說明:
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 之間。
。、更改資料:
update table_name
set column1=’xxx’
where conditoins
說明:
1.更改某個欄位設定其值為’xxx’。
2.conditions 是所要符合的條件、若沒有 where 則整個 table 的那個欄位都會全部被更改。
。、刪除資料:
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’);
文章來源于領測軟件測試網 http://www.kjueaiud.com/