Skip to content
Advertisement

i need a query to update column transferred_to to ‘Invalid_destination’ in Storage table if transferred_to column is equal 100

the query that i tried is this

UPDATE transfered_to
SET name = REPLACE(name,'Invalid_destination')
WHERE transfered_to in ( SELECT transfered_to
FROM Storage WHERE Invalid_destination = 100);

But i got this output

Table or view does not exits

so this is my table

                                       Storage
STORAGE_ID  MODEL   SERIAL_NUMBER   TRANSFERED_TO
50          s-1      1234211           51

Advertisement

Answer

You seem to want:

update `storage`
set transfered_to = 'invalid destination'
where transfered_to = '100'

Note that storage is a language keyword in MySQL, hence a poor choice for a column name. It would be simpler to use another column name, otherwise you need to quote it.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement