By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,843 Members | 2,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,843 IT Pros & Developers. It's quick & easy.

help me in understanding this update statement

P: 1
Help needed in understanding the below update statement


Expand|Select|Wrap|Line Numbers
  1. update results_key set 
  2.  
  3. result = temp.tally
  4.  
  5. from(
  6.  
  7.         select testid,result,count(*) as tally
  8.  
  9.         from reslults_emp
  10.  
  11.         where testid='e001'
  12.  
  13.      ) temp
  14.  
  15. where resluts_key.testid=temp.testid
  16.  
  17. and results_key.value=temp.result
  18.  
  19.  



According to me result expect one and only one value from temp.tally

but it is returning 2 values and the update is working perfectly

updating 2 records.



why I am confused is because I have back ground of Oracle sql plsql and in Oracle

update this is not possible it will give error stating too many rows.



can any body explain me this update statement



Thanks

aak.
Sep 25 '08 #1
Share this Question
Share on Google+
1 Reply


debasisdas
Expert 5K+
P: 8,127
you need to deeply look into the join part for your answer.
Sep 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.