How to return a default value when no rows are returned from the select statement

前端 未结 7 1892
庸人自扰
庸人自扰 2021-01-22 13:26

I have a select statement that returns two columns, a date column, and a count(value) column. When the count(value) column doesn\'t have any records,

7条回答
  •  忘掉有多难
    2021-01-22 14:12

    You may use COUNT(*). It will return zero if nothing was found for the column. Also you may group result set by value column if it is needed.

提交回复
热议问题