Table stockadj1, column category. it have Multiple columns (like idno,name,category) . But i want to get category with out duplicate values and some default values also come if its (table) there or not. So i wrote a query like this
select
'Damages' as category
union all
select
'Excess Stock' as category
union all
select
'Shortage' as category
union all
select
'Stock Journal' as category
union all
select
distinct category
from
stockadj1
where
category <> ''
and lower(category) not in ('damages', 'excess stock', 'shortage', 'stock journal')
order by
category
The default values are
'Damages', 'Excess Stock', 'Shortage', 'Stock Journal'
Those default values must come with query so am using like this. But I think its a pretty much work. How to get efficient (feasible) solution?
EDIT
Here default value means those values which maybe present in table or not.
I am using Postgresql version 9.0.3