Error in an sql in the Laravel

Asked

Viewed 104 times

2

I’m having difficulty in an sql in the Laravel where I make a Join, but the error really happens is in the where, where the deleted_at is equal to null, recalling that the deleted_at is a timestamp. The database is running sql, but the database is not. What is missing? I am using the postgres database.

Follow the error screenshot: inserir a descrição da imagem aqui

  • 1

    puts the code you are using so we can help you more, another question you used the manual query to test ?

  • Eduardo, post the code of your model and, if used, the Migrations of your table.

  • 2

    opa galera vlw by help more I already solved the problem I didn’t know there was a function "whereNull()" to do this more thanks for the help

  • 2

    Eduardo put as answer it is very good to have these mistakes and how to solve them.

1 answer

3

Null is not a value, but "unknown value", and therefore cannot be compared with normal values.

in place of

"tb_combo_produto"."deleted_at" = null

utilize

whereNull('deleted_at')
  • I posted as CW to give up the votes, because the answer is not mine, but based on a comment from the OP. If OP prefer, post as own answer, we remove this.

Browser other questions tagged

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