472,127 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

help me in understanding this update statement

Help needed in understanding the below update statement

Expand|Select|Wrap|Line Numbers
  1. update results_key set 
  3. result = temp.tally
  5. from(
  7.         select testid,result,count(*) as tally
  9.         from reslults_emp
  11.         where testid='e001'
  13.      ) temp
  15. where resluts_key.testid=temp.testid
  17. and results_key.value=temp.result

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


Sep 25 '08 #1
1 1141
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.