斷點

          每天進步一點點!
          posts - 174, comments - 56, trackbacks - 0, articles - 21

          select檢索數據

          Posted on 2010-01-14 22:06 斷點 閱讀(216) 評論(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)
          主站蜘蛛池模板: 延边| 涞水县| 酉阳| 龙海市| 讷河市| 伊通| 名山县| 海林市| 大姚县| 阿拉善左旗| 庆元县| 顺义区| 航空| 永安市| 池州市| 临邑县| 镇康县| 新巴尔虎右旗| 成都市| 雷山县| 宁德市| 鞍山市| 徐州市| 黔南| 莎车县| 雷山县| 鹰潭市| 辽源市| 子长县| 襄樊市| 台北县| 湘阴县| 杭锦旗| 宜昌市| 兰州市| 丹阳市| 宁阳县| 紫阳县| 吕梁市| 大石桥市| 黄平县|