Thursday, 30 August 2018
Subscribe to:
Post Comments (Atom)
UPDATE accountinfo
SET TAG= 'ABCD'
WHERE 'ABCD%' IN (select NAME from hardware where NAME LIKE 'ABCD%');
select NAME from hardware where NAME LIKE 'ABCD%'
ABCDABELCHIOR
ABCDABELMARQUES
ABCDAG200CX1
IN
operator is an equality comparison. Your use of the '%'
in the string literal makes it look as if you want to some sort of LIKE
comparsion... matching the first four characters.WHERE
clause of your query is going to evaluate to either TRUE or FALSE, for every in the accountinfo
table, no matter what the row in accountinfo
contains. You're either going to update none of the rows, or all of the rows.accountinfo
do you want to update?accountinfo
with rows in hardware
? How are you going to know if the rows "match"?TAG
in the accountinfo
table. And that's the only column we know about.NAME
in the hardware
table. And there are rows in the table with NAME
values that begin with 'ABCD'
.accountinfo
did you want to update? How are you going to identify which rows to update?Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment