1.distinct 问题: 每个app下只保留一个用户 案例: spark-sql> with test1 as > (select 122 as userid,100024 as apptypeid > union all > select 123 as userid,100024 as apptypeid > union all > select 123 as userid,100024 as apptyp...
1.行转列 (1)decode实现 SELECT t_year, MAX(DECODE(t_month,'1月',t_value)) AS 一月, MAX(DECODE(t_month,'2月',t_value)) AS 二月, MAX(DECODE(t_month,'3月',t_value)) AS 三月, MAX(DECODE(t_month,'4月',t_value)) AS...
10-401 查询课程“Dp010001”的最高分 select max(grade) as max_grade
from Grade
where CourseID = 'Dp010001' 10-402 查询课程“Dp010004”的学生学号和成绩,并按成绩降序排列,成绩相同按学号升序排列 select StudentID,a.Grade
from Grade as...
描述:hadoop-3.1.0启动hadoop集群时还有可能可能会报如下错误 [root@localhost sbin]# start-all.sh
Starting namenodes on [hadoop]
ERROR: Attempting to operate on hdfs namenode as root
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting oper...
SELECT 日期,地域,活跃度,COUNT(qq号) as qq个数 FROM
(SELECT a.`日期`,a.`qq号`,a.`地域`,IF(b.msg>=200,'高活跃度','低活跃度') AS 活跃度
FROM table_user AS a LEFT JOIN table_act AS b ON a.`日期` = b....
1、拼接字符串 格式一:可以使用"||"来拼接字符串 select '拼接'||'字符串' as str from dual 格式二:通过concat()函数实现 select concat('拼接', '字符串') as str from dual 注:oracle的concat函数只支持两个参数的...
1.逻辑目录创建 --登陆数据库
sqlplus as sysdba
--创建目录,用于把数据库文件导出到目录下,目录需要提前创建好
create directory dir_dump as 'D:\hbdata';
--把权限赋予你导出时用的账号
grant read,write on directory dir_dump to hb;
--推出
exi...