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 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2009-04-10 : 10:42:17
|
| [code]i need a query to import the data from Student to three tables (studentInfo,Studentsubject,StudentFee).Ex:Table:StudentId name subject Feepaid status --- ---- ------ -------- ------1 sam Math 120 PassedExecpted outputTable: studentInfo ID Name-- -----1 SamTable:StudentsubjectID subject -- -------1 Math Table:StudentFeeID Feepaid status -- ------- ------1 120 Passed[/code] |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-04-10 : 11:35:29
|
| What have you tried so far?[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2009-04-10 : 14:29:36
|
| INSERT INTOstudentInfo(ID,Name)(Select ID,nameFROMStudent)INSERT INTO Studentsubject(ID,subject )(SELECT ID,subjectFROMStudent)INSERT INTO StudentFee(ID,Feepaid,status )(SELECTID,Feepaid,status FROMStudent)Can yu suggest any other better solutions.. |
 |
|
|
|
|
|