執行如下sql:select value from table where id=1查詢出來的值可能大于0也可能小于0。我現在想把小于0的結果全都改成0輸入。這個用decode函數怎么做的?好像是select decode(value...?) from table where id=1select case when value<=0 then 0 else value end from table where id=1那如果在一個查詢語句中同時查詢兩個安段的情況應該怎么寫呢?比如:select a,b from table,對b進行判斷
想要請教sql decode函數的一個簡單用法,具體內容如下所示
飲歌長嘯
2022-03-03 11:07:18