8
を私はいくつかのレコードを選択しようとすると、テーブルから演算子は存在しません:JSON = JSON
SELECT * FROM movie_test WHERE tags = ('["dramatic","women", "political"]'::json)
SQLコードが
LINE 1: SELECT * FROM movie_test WHERE tags = ('["dramatic","women",...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
********** 错误 **********
ERROR: operator does not exist: json = json
SQL 状态: 42883
指导建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
字符:37
は、私が何かを欠場か私は学ぶことができましたエラーをキャストこのエラーに関する何か。
テキストの比較ではなく、jsonbを使用することを強くお勧めします。テキストの比較では、書式設定などのマイナーな違いによって不均等な結果が報告されるためです。 –
本当にありがとうございます。 – Fudun
ありがとう!他の誰かに役立つ場合は、List.where( "nutrition_constraints :: jsonb - >" vegetarian "? '' 1" ")。 –