SELECT SQL WITH WHERE "DOUBLE" [closed]

-5

I am trying to query the MySQL database with the following syntax

SELECT id, codigo, faca, descricao, vendedor, imagem 
FROM produtos
WHERE sit = 1
  AND descricao = ESTE

Until this part it works perfectly: SELECT id, codigo, faca, descricao, vendedor, imagem FROM produtos WHERE sit = 1

But the query has the following error when I put the last part of the code: #1054 - Coluna 'ESTE' desconhecida em 'where clause'

    
asked by anonymous 16.08.2018 / 18:32

1 answer

2

The error is exactly what Ricardo pointed out in a comment; as it is in select , ESTE is syntax of a column of table produtos , and such column does not exist (that's what the error says).

Apparently you compare if the descricao column has THIS as value, then the query would look like this:

SELECT id, codigo, faca, descricao, vendedor, imagem 
FROM produtos
WHERE sit = 1
  AND descricao = 'ESTE'
    
16.08.2018 / 19:41