Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
'cost' 値が 0 よりも大きい行のみをフェッチするクエリを作成したい.cost 列のデータ型は double です.そのようなクエリを作成すると、
select cost from xxx where cost>0;
たとえば、0.02 または 0.3 の値は取りません。クエリは、これらの型の値をゼロと見なします。どうすれば目標を達成できますか? 事前にありがとう...
mysql 5.41 を使用して問題を再現できません。
describe table xxx;の結果を表示します。
describe table xxx
クエリを発行するとどうなるか:
select cost from xxx where cost > 0.0;
あなたのクエリは実際ですか:
select ceil(cost) from xxx where cost > 0.0;
その場合、cost の値が 0 より大きく 1 より小さい場合、結果セットは 1 になります。