Reputation: 1020
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 come the output of this query is '*' ?
Please explain
Thanks
Upvotes: 4
Views: 162
Reputation: 453287
ISNULL
uses the datatype of the first argument.
This is varchar(1)
as that is the datatype of the literal '0'
999
would be truncated so SQL Server shows '*'
Upvotes: 11