how to assign a default value if no rows returned from the select query code example
Example: tsql default value when no value returned by query
SELECT ISNULL(MIN(val), 'DEFAULT')
FROM myTable
SELECT ISNULL(MIN(val), 'DEFAULT')
FROM myTable