i have a table of items which have 3 attributes (item_name ,username, bid_price).
So, in this table for each item there are many 'bid_price' (same and different) possible by different users.
So, I want to create a view of item_name, username, bid_price and condition on bid_price is that it should be unique and smallest for a particular item.
So, if there are two identical bids for a given item, you do not wish to see this bid? Is there no way to further differentiate the bids (i.e. first bid?) You would need a time stamp or serial field to determine this, though.
What version of pg are you using?
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
create or replace view v_bids
bid_price as lowest_bid_price
row_number() over (partition by item_name order by bid_price asc) as rn
where rn = 1