Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-03-24 : 15:54:52
|
| How can i add a join to the below select & make sure only get those rows which are not deleted in tableDM based on DMID field.using the following join:Join TAB_DM_log.DMID = tableDM.dmid and tableDM.deleted=0select t.DMID as Modid, t.DMTitle as description,'DM' as Type,t.Updatedfrom TAB_DM_log tjoin (select top 3 DMID, Updated = max(Updated) from TAB_DM_log where updatedby = @UserName and deleted = 0 group by DMID order by Updated desc) t2on t.DMID = t2.DMIDand t.Updated = t2.UpdatedThank you very much for the helpful info. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|