I have a SQL query as below(which is wrong) where I need to adjust the where condition as per the conditions shared.
select
'app' as appkey,'arival' as layer,
'fmcg' as sets,ID as HOME_ID,
INVO_DATE as INVOICE_DATE,
count(distinct(P_DATE||TP_ID))
where
ART_ID != "1" as dispatch,
sum(SALES_product)
where
ART_ID = "1" as product_sum, sum(SALES_area)
where
ART_ID != "1" as area_SALES
from
sales group by HOME_ID, INVO_DATE
I request to please help in making the query executable.