断点

每天进步一点点!
posts - 174, comments - 56, trackbacks - 0, articles - 21

select检索数据

Posted on 2010-01-14 22:06 断点 阅读(193) 评论(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)

只有注册用户登录后才能发表评论。


网站导航: