Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UPDATE with select statment

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

eno name phone
----------- -------------------- ----------
1 Quick and Dirty 1112223333
2 Starve Bucks 1112224444
3 JeffyGrease 1114443333
4 Stuffed Stuff 1112225555

RecommendedList
eno eateryname phone
----------- -------------------- ----------
4 Stuffed Stuff 7772225555
11 Pleasant Regrets 9992223333
12 Try Harder 8882224444
23 BBB's Choice 1114443333
1 Quick and Dirty 8882223333

" UPDATE Eateries SET Eateries.phone =
(SELECT x.phone from RecommendedList x WHERE x.eno=Eateries.eno)
WHERE Eateries.eno IN (SELECT eno FROM RecommendedList)
Referring to tables Eateries and RecommendedList in the scenario above, how many Eateries records are updated by the statement? "



the answer is 0.i can't fine how it comes ti zero.
 
Ranjan Barua
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aruna,

i have checked your query with given data, but it returns me outout "2 rows updated".

please try it again, i think there is something wrong with your tool which you are using.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it can't be happen no.isn't any error in this statments?
 
Ranjan Barua
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No there is no problem with your statement.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya ,finally i got it .but i got 2 rows.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic