顯示具有 plsql select return string if no row 標籤的文章。 顯示所有文章
顯示具有 plsql select return string if no row 標籤的文章。 顯示所有文章

2015年6月24日 星期三

oracle 找一筆找不到的資料 oracle find null record

假設資料表有一個欄位 10筆資料 數值為1~10
下查詢 WHERE 此欄位=11
就會回傳0列
但想要他回傳0列時顯示某字串
就先套一個max 再去套nvl 或decode之類的case功能


select nvl(max(column),'0') AS something from table
where 不能找到資料的條件