468,242 Members | 1,515 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

help me in understanding this update statement

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
1 1076
debasisdas
8,127 Expert 4TB
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.

Similar topics

9 posts views Thread by netpurpose | last post: by
4 posts views Thread by Big D | last post: by
3 posts views Thread by Altman | last post: by
6 posts views Thread by GrandpaB | last post: by
2 posts views Thread by Mark | last post: by
4 posts views Thread by Andrew Taylor | last post: by
2 posts views Thread by Greg Corradini | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.