斷點

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

          select檢索數(shù)據(jù)

          Posted on 2010-01-14 22:06 斷點 閱讀(215) 評論(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:指定某個范圍內(nèi)的所有值,包括指定值本身。

          7.in用來指定一條列值:select * from web_fin_dcr t where t.n_item_no in(1,2);

          8.order by:對檢索到的數(shù)據(jù)進行排序,默認為升序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來檢索唯一的表列值,也就是檢索哪些不同的數(shù)據(jù):

              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)
          主站蜘蛛池模板: 盐津县| 郸城县| 台中市| 石楼县| 新竹县| 林西县| 长治县| 永嘉县| 筠连县| 鹤庆县| 宝丰县| 云霄县| 岱山县| 芜湖市| 桐乡市| 健康| 大关县| 新蔡县| 旅游| 许昌市| 隆尧县| 梅州市| 鄂伦春自治旗| 太白县| 惠安县| 屏山县| 龙胜| 左云县| 武平县| 屯昌县| 富平县| 武威市| 宣武区| 伊金霍洛旗| 江口县| 陆丰市| 宜阳县| 安平县| 聂荣县| 美姑县| 抚州市|