| Author |
UPDATE with select statment
|
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
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
Joined: Sep 08, 2009
Posts: 5
|
|
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.
|
Ranjan Kumar Barua
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
|
it can't be happen no.isn't any error in this statments?
|
 |
Ranjan Barua
Greenhorn
Joined: Sep 08, 2009
Posts: 5
|
|
|
No there is no problem with your statement.
|
 |
sameera liyanage
Ranch Hand
Joined: Nov 25, 2008
Posts: 643
|
|
ya ,finally i got it .but i got 2 rows.
|
 |
 |
|
|
subject: UPDATE with select statment
|
|
|