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 |
|
konark
Yak Posting Veteran
60 Posts |
Posted - 2009-06-02 : 19:43:38
|
| STUDENT_DETAILStudentID MonthID SubjectType NoofUnitTests1000 20090101 PHY 21001 20090101 PHY 11002 20090101 PHY 11003 20090101 PHY 31004 20090101 PHY 11005 20090101 PHY 21000 20090201 PHY 21001 20090201 PHY 11002 20090201 PHY 11003 20090201 PHY 31004 20090201 PHY 11005 20090201 PHY 21000 20090101 CHEM 21001 20090101 CHEM 01002 20090101 CHEM 11003 20090101 CHEM 11004 20090101 CHEM 11005 20090101 CHEM 21000 20090201 CHEM 31001 20090201 CHEM 11002 20090201 CHEM 01003 20090201 CHEM 31004 20090201 CHEM 11005 20090201 CHEM 2LOOKUPStudentID StudentRoll1000 101001 111002 121003 131004 141005 15OUTPUT STUDENT_MASTERStudentRoll MonthID Type Total10 20090101 PHY 211 20090101 PHY 112 20090101 PHY 113 20090101 PHY 314 20090101 PHY 110 20090101 CHEM 211 20090101 CHEM 012 20090101 CHEM 113 20090101 CHEM 114 20090101 CHEM 110 20090201 PHY 211 20090201 PHY 112 20090201 PHY 113 20090201 PHY 314 20090201 PHY 115 20090201 PHY 210 20090201 CHEM 311 20090201 CHEM 112 20090201 CHEM 013 20090201 CHEM 314 20090201 CHEM 115 20090201 CHEM 2I want to write a procedure which will load the STUDENT_MASTER from STUDENT_DETAIL .I am a new bee , doing a college project. Please help me in doing it in the most efficient way.Chandragupta Mourya |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-06-02 : 23:57:03
|
| select StudentRoll,MonthID, SubjectType, NoofUnitTestsfrom LOOKUP l inner join STUDENT_DETAIL sd on sd.StudentID = l.StudentID |
 |
|
|
konark
Yak Posting Veteran
60 Posts |
Posted - 2009-06-09 : 17:26:40
|
| Thats not the rquirement. The data in STUDENT_DETAIL will always refresh last 2 months data and the proposed procedure will insert/update (merge) those 2 months data into STUDENT _MASTER?Chandragupta Mourya |
 |
|
|
|
|
|