select termId, entityId, max(enddate)
from Terms
where entityId = 1234
group by termId, entityId
This does return me one row:
select *
from Terms
where enddate in (select max(enddate)
from Terms
where entityId = 1234)
What I would like to do this in one select statement. Does anyone have any suggestions?
Quote:
Originally Posted by NamelessNumberheadMan
What I'm trying to do is get the last entry (by date) for a given entity (which should be a single row). The following returned more than one row:
select termId, entityId, max(enddate)
from Terms
where entityId = 1234
group by termId, entityId
This does return me one row:
select *
from Terms
where enddate in (select max(enddate)
from Terms
where entityId = 1234)
What I would like to do this in one select statement. Does anyone have any suggestions?
I think your query is correct. I cant get what you mean for simplify my query?
If you want you have to explain your requirement
No comments:
Post a Comment