|
-
Feb 15th, 2006, 09:23 AM
#1
Thread Starter
Frenzied Member
Help with sql!!!
I am puzzled with this query:
I have three tables
A
--------------
data_id
status_id
etc
A_B
------------
data_id
status_id
status_date
B
-----------
status_id
status_description
Do you understand? In table A I have items, each item can have one or many statuses since Im using a link table A_B. And when I add a new status in A_B I also set a date when this new status was born.
The problem is, how can I write a sql query so I list only those items in A that has the LATEST status. All I have to go on is the status_date
I dont want multiple data_id in my resultset, only unique data_id with the latest status as set in A_B
please help me!! This is oracle9i, but i understand t-sql too...
/Henrik
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
|