- Más nuevo
- Más votos
- Más comentarios
The error message is indicating that the DATE_FORMAT function is being used on the "line_item_usage_start_date" column, but it is not being included in the GROUP BY clause. The DATE_FORMAT function is used to format the date to a specific format, but it must be included in the GROUP BY clause along with the other columns that are being selected in the query.
In the GROUP BY clause, you need to include the month_line_item_usage_start_date which is the DATE_FORMAT function applied on line_item_usage_start_date.
SELECT DATE_FORMAT((line_item_usage_start_date),'%Y-%m-%d') AS month_line_item_usage_start_date, SUM(CASE WHEN (line_item_line_item_type = 'SavingsPlanNegation') THEN 0 ELSE line_item_unblended_cost END) AS sum_line_item_unblended_cost, SUM(CASE WHEN (line_item_line_item_type = 'SavingsPlanCoveredUsage') THEN savings_plan_savings_plan_effective_cost WHEN (line_item_line_item_type = 'SavingsPlanRecurringFee') THEN (savings_plan_total_commitment_to_date - savings_plan_used_commitment) WHEN (line_item_line_item_type = 'SavingsPlanNegation') THEN 0 WHEN (line_item_line_item_type = 'SavingsPlanUpfrontFee') THEN 0 WHEN (line_item_line_item_type = 'DiscountedUsage') THEN reservation_effective_cost WHEN (line_item_line_item_type = 'RIFee') THEN (reservation_unused_amortized_upfront_fee_for_billing_period + reservation_unused_recurring_fee) WHEN ((line_item_line_item_type = 'Fee') AND (reservation_reservation_a_r_n <> '')) THEN 0 ELSE line_item_unblended_cost END) AS amortized_cost, SUM(CASE WHEN (line_item_line_item_type = 'SavingsPlanRecurringFee') THEN (-savings_plan_amortized_upfront_commitment_for_billing_period) WHEN (line_item_line_item_type = 'RIFee') THEN (-reservation_amortized_upfront_fee_for_billing_period) WHEN (line_item_line_item_type = 'SavingsPlanNegation') THEN (-line_item_unblended_cost) ELSE 0 END) AS ri_sp_trueup, SUM(CASE WHEN (line_item_line_item_type = 'SavingsPlanUpfrontFee') THEN line_item_unblended_cost WHEN ((line_item_line_item_type = 'Fee') AND (reservation_reservation_a_r_n <> '')) THEN line_item_unblended_cost ELSE 0 END) AS ri_sp_upfront_fees FROM "cudos_aggregated_cur_db"
Contenido relevante
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace un año