插入数据
insert into classname values(2,“大数据二班”);
建表语句
create table order_his(
create_date string,
order_id string,
order_status string,
dw_begin_date string,
dw_end_date string
)ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,’;
加载数据到Hive
load data local inpath ‘/root/1.txt’
into table order_his;
表的连接
内连接
select w.id,w.name
from websites w
join access_log a
on w.id=a.site_id
group by w.id,w.name;
只匹配相同的字符
外连接
left outer join 左外连接,先保存左表全部,再来连接右表。
right outer join 右外连接,先保存右表全部,再来连接左表。