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 |
|
ceema
Yak Posting Veteran
80 Posts |
Posted - 2006-04-20 : 05:18:58
|
| Hello, I have One table having (BusList) SchoolID,ClassID,RegNo,sClass as fields . Another table having(SchoolClass) ClassID,SClass,SchoolID as fieldsNow my problem is, I have to update Buslist table's ClassID field which is having null(all are null) values with the ClassID field of Bus Table.I meanI have the following values in Buslist tableBusList---------SchoolID ClassID RegNo SClassIHS Null 1000 1-AIHS Null 1001 1-AIHS Null 1002 KG1-AIHS Null 1003 1-ABRT Null 1002 KG1-ABRT Null 1003 1-ASchoolClass-----------ClassID SClass SchoolID1 1-A IHS2 KG1-A IHS1 1-A BRT2 KG1-A BRTSo, I have to update BusList asSchoolID ClassID RegNo SClassIHS 1 1000 1-AIHS 1 1001 1-AIHS 2 1002 KG1-AIHS 1 1003 1-ABRT 2 1002 KG1-ABRT 1 1003 1-AAny body having any suggestionThank you so muchCeema |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-20 : 05:23:50
|
| Update B set CalssId=S.CalssIdfrom BusList B inner join SchoolClass Son B.SClass=S.SClassMadhivananFailing to plan is Planning to fail |
 |
|
|
ceema
Yak Posting Veteran
80 Posts |
Posted - 2006-04-22 : 00:59:05
|
| Hello madhivanan, Sorry for being late in expressing my thanks. Today only I checked it. Thank you so much, it's working fine.Thanks youCeema |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-24 : 02:14:12
|
| Well. Also read about Update in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|