就业数据资源平台
当前位置:首页 > 数据库技术
快速把握一些异常精妙的SQL语句

  精妙的"SQL"语句:
  复制表
  SQL: selectinto b from a where 11
  拷贝表
  SQL: insert into b select d,e,f from b;
  显示文章、提交人和最后回复时间
  SQL: select a.title,a.username,b.adddate from table a,
  adddate from table where table.title=a.title) b
  说明:外连接查询
  SQL: select a.a, a.b, a.c, b.c, b.d, b.f from a LEFT OUT JOIN b ON a.a =
  b.c
  日程安排提前五分钟提醒
  SQL: selectfrom 日程安排 where datediff)5
  两张关联表,删除主表中已经在副表中没有的
  SQL:
  delete from info where not exists
  说明:
  SQL:
  SELECT A.NUM, A.NAME, B.UPD_DATE, B.PREV_UPD_DATE
  FROM TABLE1, = TO_CHAR) X,
  = TO_CHAR ’/01’,’
  YYYY/MM/DD’) - 1, ’YYYY/MM’) ) Y, WHERE X.NUM = Y.NUM
  (+)AND X.INBOUND_QTY + NVL
  X.STOCK_ONHAND ) B WHERE A.NUM = B.NUM
  说明:
  SQL:
  selectfrom studentinfo where not exists and 系名称=’"strdepartmentname"’ and 专业名称=’"strprofessionname"’ order by 性别,生源地,高考总成绩。
就业数据资源平台