MySQL cannot delete the where in column contains-

there is a field of type String name in the database.

I want to try to delete two columns:

DELETE
FROM
img
WHERE NAME
IN(
    FuvKctrx3Cvg4t-HrA6gylGscgoi,
    FisVPEZDbBnrMsEC5yYGFPmesBp1
)

but sql returns -sharp1054-Unknown column "FuvKctrx3Cvg4t" in" where clause"

because the name column contains -, how can we delete the entire column?

Jul.09,2021

The

string should be enclosed in quotation marks, otherwise it is considered to be a column name

DELETE
FROM
img
WHERE NAME
IN(
    'FuvKctrx3Cvg4t-HrA6gylGscgoi',
    'FisVPEZDbBnrMsEC5yYGFPmesBp1'
)
Menu