I need to do a query and retrive a filtered set of data.
Basically I have a composite primary key
item_code
Price_Area_code
price_bracket_cd
effect_date
an item can be in multiple price_areas , and will have historical entries
over time.
to get the current row, I have to check effect_date > current date and
end_effect_date < current date
what I need to do is get a list of item_codes in a given price_area,
regardless of how many brackets entries there are
select a distnct (item_code) where price_area = 1 and effect_date ....
how can I tell ojb which column I want to make distinct?
Could I do a subselect?
select * from xx_table a where
item_code in(select (distinct) where price_area = 1 and
effect_date ....)
thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]