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 |
|
reddymade
Posting Yak Master
165 Posts |
Posted - 2005-11-21 : 12:49:17
|
| I am trying make a join and get last 3 records lastmodified by datetime.Can you please tell me how do i need to make a join:SELECT c.CNID,p.projnoFROM tab_cn c, tab_projects p where c.projid = p.projid and( select Top 3 * from TAB_CN ORDER BY last_modified DESC) XORDER BY last_modified ASCThank you very much for the help. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-21 : 12:54:04
|
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxpoint 2Go with the flow & have fun! Else fight the flow |
 |
|
|
reddymade
Posting Yak Master
165 Posts |
Posted - 2005-11-21 : 13:02:43
|
| Hello Mr. Spirit,Its not a beginner's question, the one i asked. Please if you know, try to answer. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-21 : 13:15:30
|
so basicaly you just want this?SELECT Top 3 c.CNID,p.projnoFROM tab_cn c join tab_projects p on c.projid = p.projid ORDER BY last_modified DESCGo with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-22 : 00:02:05
|
quote: Originally posted by reddymade I am trying make a join and get last 3 records lastmodified by datetime.Can you please tell me how do i need to make a join:SELECT c.CNID,p.projnoFROM tab_cn c, tab_projects p where c.projid = p.projid and( select Top 3 * from TAB_CN ORDER BY last_modified DESC) XORDER BY last_modified ASCThank you very much for the help.
Did your query give any error or unexpected result?MadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-22 : 05:09:40
|
his query never worked...Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|