LoginSignup
0
0

More than 5 years have passed since last update.

laravelのクエリビルダでinvalid input syntax for type timestampメモ

Posted at

where句を使うときは種類がいっぱいあるのを知らなかった

  • laravelのクエリビルダを利用してDBへアクセスした際にinvalid input syntax for type timestampがでてしまった。
  • sqlを直書きすれば返ってくる。
  • 全部whereで繋いでいた。
  • カラム同士を比較した際にはwhereColumnを使用しなければならなかった。
  • timestamp型のカラムの比較を、whereColumnではなくwhereで行うとinvalid input syntax for type timestampのエラーが返ってくる。
    • where('DB1.time', '<', 'DB2.time')のようなことをやるとエラーが返ってくる。
    • DB1.timeが文字列型だとエラーは吐かれないが'DB2.time'という文字列を探しにいく

※間違いがあったら教えてください

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0