数据库查询相关操作.docxVIP

  • 19
  • 0
  • 约7.33千字
  • 约 10页
  • 2016-11-29 发布于重庆
  • 举报
数据库查询相关操作

查看表结构DESC table1查询语句select * from 表1 where 条件 order by 列名 desc/asc//在表1中查询符合条件的记录 并按照某列降序/升序排列条件的关键字 and or not between andlike ‘ ’%表示一个或多个字符,_表示一个字符 not like ’ ’in(’’,’’ ,’’ ) 某字段的值在所属范围内的记录is /is not null查询字段内容为空/非空的语句select * from table1 where 工资2500 and 工资3000 select 姓名 from table1 where 性别=0 and 工资=4000select * from table1 where not 工资= 3200select * from table1 order by 工资desc //将工资按照降序排列,默认为升序select * from table1 order by 工资 asc //将工资按照升序排列SELECT * FROM table1 order by dept, sal desc //按部门升序,并按薪酬降序select * from table1 where year(出身日期)=1987 //查询table1 中所有出生在1987的人模糊查询select * from tab

文档评论(0)

1亿VIP精品文档

相关文档