[dba-SQLServer] Null and DISTINCT

David McAfee davidmcafee at gmail.com
Sat Sep 19 19:24:12 CDT 2009


use ISNULL(yourfieldwithanullvalue,'someValueHere') in the select
statment. It works like VBA's NZ function

On Fri, Sep 18, 2009 at 10:52 AM, jwcolby <jwcolby at colbyconsulting.com> wrote:
> I have a result set where I have a ton of records that are absolutely identical.  I am trying to do
> a DISTINCT but there is one field that is pulling a NULL.  Is it true that the NULL will prevent the
> DISTINCT from working in this case?
>
> Any way around this?
> --
> John W. Colby
> www.ColbyConsulting.com
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>




More information about the dba-SQLServer mailing list