|
-
Asuming the trans_status_cd makes the record unique, you might try something along the lines of:
select prod_id, prod_nm, trans_status_cd,
seek_offer, cat_id, cat_nm, user_id
from activity_tracker
where (prod_id, prod_nm, trans_status_cd,
seek_offer, cat_id, cat_nm, user_id )
in (
select prod_id, prod_nm, max(trans_status_cd)
from activity_tracker
where user_id = 207
and trans_status_cd <> 'T'
group by prod_id, prod_nm
)
and where user_id = 207
and trans_status_cd <> 'T'
However, this is only a hack. Your fundemental problem lies in the fact that the relational design is kinda out of whack. In the relational world, you should have a table of products (prod_id, prod_nm) and then only the prod_id should be stored in activity_tracker.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|