INSERT CLAUSE
a.single table insert
INSERT INTO jobs(job_id,job_title,min_salary,Max_Salary)
VALUES('IT_PM','PROJECT MANAGER',5000,11000); INSERT INTO scott.bonus(ename,job,sal,comm)
SELECT ename,job,sal*.10
FROM scott.emp;
b.more table insert
create table small_table(
customer_id number,
sum_orders number
);
create table medium_table(
customer_id number,
sum_orders number
);
create table larger_table(
customer_id number,
sum_orders number
);
INSERT ALL
WHEN sum_orders<1000 THEN
INTO small_table
WHEN sum_orders>=1000 AND sum_orders<1000 THEN
INTO medium_table
ELSE
INTO larger_table
SELECT customer_id,SUM(order_total) sum_orders
FROM oe.orders
GROUP BY customer_id;
INSERT CLAUSE的更多相关文章
- [Hive - LanguageManual] DML: Load, Insert, Update, Delete
LanguageManual DML Hive Data Manipulation Language Hive Data Manipulation Language Loading files int ...
- Oracle Database 11g express edition
commands : show sys connect sys as sysdba or connect system as sysdba logout or disc clear screen or ...
- [Hive - Tutorial] Querying and Inserting Data 查询和插入数据
Querying and Inserting Data Simple Query Partition Based Query Joins Aggregations Multi Table/File I ...
- hibernate总结四
HIbernate-查询语句 Hibernate Query Language (HQL) 是一个面向对象的查询语言,与Sql相似, 相对于sql对表和列的操作, HQL是对持久对象和他们的属性进行操 ...
- 【转】Hive Data Manipulation Language
Hive Data Manipulation Language Hive Data Manipulation Language Loading files into tables Syntax Syn ...
- Hive Tutorial 阅读记录
Hive Tutorial 目录 Hive Tutorial 1.Concepts 1.1.What Is Hive 1.2.What Hive Is NOT 1.3.Getting Started ...
- 省市区三级-sql脚本:
/*Navicat MySQL Data Transfer Source Server : moiraiSource Server Version : 50631Source Host : 192.1 ...
- 将表里的数据批量生成INSERT语句的存储过程 增强版
将表里的数据批量生成INSERT语句的存储过程 增强版 有时候,我们需要将某个表里的数据全部或者根据查询条件导出来,迁移到另一个相同结构的库中 目前SQL Server里面是没有相关的工具根据查询条件 ...
- Sql Server系列:Insert语句
1 INSERT语法 [ WITH <common_table_expression> [ ,...n ] ] INSERT { [ TOP ( expression ) [ PERCEN ...
随机推荐
- 深度学习(十) GoogleNet
GoogLeNet Incepetion V1 这是GoogLeNet的最早版本,出现在2014年的<Going deeper with convolutions>.之所以名为“GoogL ...
- C 标准库 - string.h之memcpy使用
memcpy Copy block of memory Copies the values of num bytes from the location pointed to by source di ...
- PTA (Advanced Level) 1013 Battle Over Cities
Battle Over Cities It is vitally important to have all the cities connected by highways in a war. If ...
- 每天一道剑指offer-二叉树的下一个结点
题目 每天一道剑指offer-二叉树的下一个结点 https://www.nowcoder.com/practice/ef068f602dde4d28aab2b210e859150a?tpId=13& ...
- [转]log4net 发布到生产环境不写日志的解决方法--使用 NLog日志
本文转自:http://www.cnblogs.com/weiweictgu/p/5848805.html 1.升级到log4net的最新版 PM下执行 Install-Package log4net ...
- webpack 报错 No PostCSS Config found 解决方案。
webpack 报错 No PostCSS Config found 这个问题我在百度上找了好久,也没有找到解决方案,最后没有办法只能自己去啃官方文档,本案例在本人的webpack 学习感悟中已经写 ...
- C# 之VS程序打包
VS2012没有自带打包工具,所以要先下载并安装一个打包工具.我采用微软提供的打包工具: InstallShield2015LimitedEdition.下载地址:http://pan.baidu. ...
- SQL 之相关语法及操作符
概述:UNION.SELECT INTO.INSERT INTO SELECT.SQL 约束. UNION操作符 UNION 操作符用于合并两个或多个 SELECT 语句的结果集. 请注意,UNION ...
- spring AOP为什么配置了没有效果?
spring Aop的配置一定要配置在springmvc配置文件中 springMVC.xml 1 <!-- AOP 注解方式 :定义Aspect --> <!-- ...
- log4j2配置文件
项目里面经常用到日志,Java开发一般用log4j.slf4j这些框架,看着配置文件有点懵.这几天看公司代码的时候,也有用到log4j,感觉要复杂一点.在本地打log,也有打到hive里面存的.看了一 ...