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.
クエリで、従業員の月給を提示したいと考えています。結果がそれを下回っている場合は、クエリで 1500 の給与を提示したいと考えています。そうでない場合は、クエリで得た合計を維持したいと考えています。
誰もそれを行う方法を知っていますか?
基本的な考え方は、caseステートメントを使用することです。このようなもの:
case
select (case when salary < 1500 then 1500 else salary end) as salary
select case when salary<1500 then 1500 else salary end , column2 ,column3 from mytable