CREATE TABLE #t (c REAL)
INSERT INTO #t VALUES (0)
SELECT COUNT(*) FROM #t WHERE c=''
In above statement you expect getting 0 rows to be returns as we filter out for all nonempty rows..But it returns 1 and the answer you find looking at execution plan.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvOp_EdVBD1PaFFuxVgGMCsveVx_r_IzbTLlAFtm-_Hhet_Gmk70dB14mm7IpoyLci6Y0bI8zLFaebsqqw1yF4xM_gqXqUBTpwqXz7V7AWJvKGTlZPqdcejAKhl9M5htmwnkjO3ofQvrz4/s320/1.jpg)
SQL Server will implicitly convert '' to REAL datatype with 0 and a result is 1 row to be return.
2 comments:
Thank you so much for everything you do.
Emergency Dentist London
A huge collection of all the celebrity net worths of the world. How much is celebrity worth? Compare yourself to your favorite celebrity. A huge collection of all the Celebrity net worth of the world. How much is celebrity worth? Compare yourself to your favorite celebrity.
Post a Comment