Posted on 2010-01-14 22:06
斷點 閱讀(214)
評論(0) 編輯 收藏 所屬分類:
SQL
1.在where子句中使用比較運算符:= ,!=(不等于) , <> (不等于), < ,> ,<= ,>= ,like。
2.使用比較運算符like:%通配符可以匹配任何長度的字符;_每個下劃線匹配一個字母。
3.or:或的意思。
4.and:連接的兩個條件必須同時滿足。
5.not 非:select * from web_fin_dcr t where not t.n_item_no in(1,2);
6.between...and:指定某個范圍內的所有值,包括指定值本身。
7.in用來指定一條列值:select * from web_fin_dcr t where t.n_item_no in(1,2);
8.order by:對檢索到的數據進行排序,默認為升序asc(ascend),降序為desc(descend)。
select * from web_fin_dcr t where t.n_item_no in(1,2,3) order by t.n_item_no desc;
9.distinct來檢索唯一的表列值,也就是檢索哪些不同的數據:
select distinct t.c_cav_flag from web_fin_dcr t where t.n_item_no in(1,2,3);
posted @ 2009-01-12 16:19 斷點 閱讀(61) | 評論 (0)