Home > database >  Mysql analysis function grammar problems
Mysql analysis function grammar problems

Time:04-17

As title, the code for

The select adb_time, week_name
, the sum (busi_table_sub_discount_num) over ()
, the sum (busi_table_sub_discount_num)
The from ads_busi_daily_report_di_v3
Where adb_time & lt;=20210415 and adb_time & gt;=20210412
Group by adb_time week_name,
The result error: ` qbi `. ` sum ` (` busi_table_sub_discount_num `) OVER () 'must be an aggregate expression or appear in GROUP BY clause
Is the analysis of the function fields must also be in the aggregate function or the groupby, however, question, the sum () polymerization isn't it?

In the end I was solved through a layer of the sum in the set of, but the question think impassability, beg you bosses, correct, and I remember I wrote before,,,, oracle can use
  • Related