Click here to Skip to main content
15,884,176 members
Home / Discussions / Database
   

Database

 
GeneralRe: how to update a sum value from join tables? Pin
Eunice (VB junior)8-Oct-07 16:18
Eunice (VB junior)8-Oct-07 16:18 
AnswerRe: how to update a sum value from join tables? Pin
pmarfleet5-Oct-07 1:02
pmarfleet5-Oct-07 1:02 
GeneralRe: how to update a sum value from join tables? Pin
Eunice (VB junior)8-Oct-07 16:20
Eunice (VB junior)8-Oct-07 16:20 
Questiondate format Pin
Sonia Gupta4-Oct-07 23:19
Sonia Gupta4-Oct-07 23:19 
AnswerRe: date format Pin
N a v a n e e t h5-Oct-07 0:29
N a v a n e e t h5-Oct-07 0:29 
Questionretrive data with the help of pointer Pin
syibu4-Oct-07 22:35
syibu4-Oct-07 22:35 
Questionhow to update statement from subselect? Pin
Eunice (VB junior)4-Oct-07 22:29
Eunice (VB junior)4-Oct-07 22:29 
AnswerRe: how to update statement from subselect? Pin
MatthysDT5-Oct-07 1:59
MatthysDT5-Oct-07 1:59 
Eunice (VB junior) wrote:
update udtstudent set(score,Testdate,MarkDate)in(select sum(studentscore),TestDate,MarkDate from udtQuestionHistory where TestID =1 and EmpNo=35 group by empno,testid)
where TestID =1 and EmpNo=35


Try this:
update udtstudent set a.score=b.scoreSum,a.TestDate=b.Testdate a.MarkDate = b.MarkDate from udtstudent a,(select sum(studentscore),TestDate,MarkDate from udtQuestionHistory where TestID =1 and EmpNo=35 group by empno,testid) b where a.TestID =1 and a.EmpNo=35

I didn't test it.

Also check your relationships and make certain that only one row is returned from the sub query!


_______________________________________________________________________
http://www.notreadytogiveup.com/Doubts.aspx[^]
"you can't forget something you never knew..." M. Du Toit



GeneralRe: how to update statement from subselect? Pin
Eunice (VB junior)8-Oct-07 16:22
Eunice (VB junior)8-Oct-07 16:22 
AnswerRe: how to update statement from subselect? Pin
GuyThiebaut5-Oct-07 9:59
professionalGuyThiebaut5-Oct-07 9:59 
GeneralRe: how to update statement from subselect? [modified] Pin
Eunice (VB junior)8-Oct-07 15:45
Eunice (VB junior)8-Oct-07 15:45 
GeneralRe: how to update statement from subselect? Pin
GuyThiebaut8-Oct-07 22:42
professionalGuyThiebaut8-Oct-07 22:42 
Questionalteration of date format in table column Pin
Sonia Gupta4-Oct-07 21:57
Sonia Gupta4-Oct-07 21:57 
AnswerRe: alteration of date format in table column Pin
Colin Angus Mackay4-Oct-07 22:08
Colin Angus Mackay4-Oct-07 22:08 
AnswerRe: alteration of date format in table column Pin
Imran Khan Pathan4-Oct-07 23:08
Imran Khan Pathan4-Oct-07 23:08 
GeneralRe: alteration of date format in table column Pin
Sonia Gupta4-Oct-07 23:22
Sonia Gupta4-Oct-07 23:22 
GeneralRe: alteration of date format in table column Pin
pmarfleet4-Oct-07 23:28
pmarfleet4-Oct-07 23:28 
QuestionSQLServer Activity Logs Pin
Vasudevan Deepak Kumar4-Oct-07 20:56
Vasudevan Deepak Kumar4-Oct-07 20:56 
QuestionProblem in Join Pin
banker_kiran4-Oct-07 20:39
banker_kiran4-Oct-07 20:39 
AnswerRe: Problem in Join Pin
pmarfleet4-Oct-07 22:05
pmarfleet4-Oct-07 22:05 
Questionproblem in a query Pin
Shuaib wasif khan4-Oct-07 13:55
Shuaib wasif khan4-Oct-07 13:55 
AnswerRe: problem in a query Pin
pmarfleet4-Oct-07 19:47
pmarfleet4-Oct-07 19:47 
QuestionTableAdapter Insert Query - a mystery Pin
dmagnant4-Oct-07 9:42
dmagnant4-Oct-07 9:42 
AnswerRe: TableAdapter Insert Query - a mystery Pin
dmagnant4-Oct-07 9:57
dmagnant4-Oct-07 9:57 
QuestionProblem with local website after using SSMSE to access the database Pin
Sunset Towers4-Oct-07 8:13
Sunset Towers4-Oct-07 8:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.