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

前端 未结 7 1777
庸人自扰
庸人自扰 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.

    0 讨论(0)
提交回复
热议问题