SQL Server Query Strange Query

I have the following SQL Server query:

SELECT ISNULL(MIN(P), 999) AS FLD FROM (SELECT '0' AS P) AS T WHERE (1 > 4) 

How is the result of this query: "*"?

Please explain

thanks

+4
source share
1 answer

ISNULL uses the data type of the first argument.

This is varchar(1) since it is the literal data type '0'

999 will be truncated, so SQL Server shows '*'

+11
source

All Articles