q229817426@163.com

q229817426@163.com45
posts - 9, comments - 1, trackbacks - 0, articles - 0

SQL语句用法简单写

Posted on 2007-10-16 21:11 link 阅读(736) 评论(0)  编辑 收藏 引用 所属分类: c++编程

      查询
1.SELECT * form 表明
选择所有的这个表
2.select i_name,i_age from form
选择字段名来自什么表
3.select * from info where v_cip=true
where 条件
4.select * from info where v_cip=true and i_age>30
      模糊查询
1.select * from info where i_name like '*小*'
2。select * from info where i_name like '?小*'
第二个字符是小
3.
*代表多个字符
?代表一个字符
4.select top 2 * from info
      排序order

1.asc正排序
2.desc倒排序
3.select * from info order by i_sex asc,i_age desc
4.<>不等于
      连接
1.select * from info,user where user.u_id=info.i_uid
      插入
insert into user(u_user,u_code)
value ('fif','test')
    修改update form
1.update info
set i_age=I_age+1
2.update info
set i_age=20 i_vip=flase
where i_vip=true
    删除
1.delete form
where 条件
如果没有where就删除表中所有元素
列子
delete from info where i_age=20


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理