Hi,
One of the column in my table is having nulls and data for few records i.e. it is not a mandatory column during data load.
For example there may be few records with data as "Cancellation". I want to use this as a filtering condition for one of my requirement.
I am aggregating the data based on certain conditions and i want to exclude the record which is having specific data in the aggregation.
The query would be something like below and I am referring column3 in the query. As the table contains nulls for column3, it is not producing me desired results. Hence, do I need to have some dummy data in Column 3 for all the records to make this query work?
select column1,column2,sum((value-column5)-(column6+column7+column8+column9)) as FRESH_COMM_Agg
from XXXX
where column10 between v_startdate and v_enddate
and co=2 and channel='XXX' and genericattribute1 not in (select locationname from location_name) and genericattribute1<>'XXX'
and column11 in (select column1 from YYYY where column2 ='XXX')
and column4='FRESH'
and column3 <>'Cancellation'
group by column1,column2
Regards,
Badari B.