-
Notifications
You must be signed in to change notification settings - Fork 484
Description
SELECT
COUNT( 0 ) ct,
any_value ( store_id ) id,
any_value ( store_name ) NAME,
any_value ( rec.store_type ) stype,
any_value (
DATE_FORMAT( rec.create_time, '%Y-%m-%d' )) dt,
any_value ( 0 ) AS type
FROM
op_order_hotel_accommodation_rec rec
INNER JOIN basic_hotel_info hotel ON hotel.id = rec.store_id
WHERE
rec.actual_checkin_time BETWEEN '2023-10-18'
AND '2023-11-24'
AND store_id = '1782421961759117546'
GROUP BY
id,
dt,
name,
stype,
type
UNION
SELECT
COUNT( 0 ) ct,
any_value ( store_id ) id,
any_value ( store_name ) NAME,
any_value ( rec.store_type ) stype,
any_value (
DATE_FORMAT( rec.create_time, '%Y-%m-%d' )) dt,
any_value ( 1 ) AS type
FROM
op_order_hotel_accommodation_abroad rec
INNER JOIN basic_hotel_info hotel ON hotel.id = rec.store_id
WHERE
rec.actual_checkin_time BETWEEN '2023-10-18'
AND '2023-11-24'
AND store_id = '1782421961759117546'
GROUP BY
id,
dt,
name,
stype,
type;
提示错误信息:
Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Aggregate expression is illegal in GROUP BY clause。