datalength  user_name

Chapter 15: Using the Built-In Functions in Queries

isnull

This query finds the average of the prices of all titles, substituting the value “$10.00’’ for all NULL entries in price:

select avg(isnull(price,$10.00)) 
from titles
------------
       14.24
 
(1 row affected)




Copyright © 2005. Sybase Inc. All rights reserved. user_name

View this book as PDF