Error Code: 1054. Unkowm column

Asked

Viewed 294 times

2

I’m looking for a value from an account I made in SQL:

(Valor - (select Visibilidade)) AS Diferenca

When I try to consult:

Diferenca <= 500

It presents the following error:

Error Code: 1054. Unknown 'Diferenca' in 'where clause'

1 answer

2


Unable to use the alias in the clause where, instead make your query like this:

select suasColunas from suaTabela where (Valor - (select Visibilidade)) <= 500

Browser other questions tagged

You are not signed in. Login or sign up in order to post.