6、Where:Simple select with like and between and so on
First we check table and data
SQL
select * from "HANA04"."EMPDIM"
where empid like '%A%'
is contain A,not middle letter is A
for example
7、Use function max、 count 、sum、 avg、 round
Check table
SQL
Limit:
Offset
8、Group by
Ok we firstly insert a new data
--insert data
insert into "HANA04"."EMPFACT1" values ('AA1','20160909','2000')
-- get sum amount group by empid
select empid,sum(sal) from "HANA04"."EMPFACT1" group by empid
Let's look at an error sentence
select
empid,
empdate,
sum(sal) from
"HANA04"."EMPFACT1" group by empid
Error message show we must add filed EMPDATE in group by
I think it is not what you want to see.
So when you want to use sum…group by, you should pay attention to the select field,
because you must group by all fields in your selected fields (except sum field)
Avg
Round
Also you can get avg value with group by
select empid ,avg(sal) from "HANA04"."EMPFACT1"
group by empid
友情推广:
第一课堂HANA系统搭建完成,公网双IP访问,速度有保证,
进第一课堂群139446252,免费领取HANA测试账号。
申请时验证信息可输入来自本博客