Re: WITH CUBE, Null and Empty string
- From: --CELKO-- <jcelko212@xxxxxxxxxxxxx>
- Date: Wed, 18 Nov 2009 03:05:56 -0800 (PST)
Is there a way to group these together so that nulls and empty strings are aggregated into the same row? <<
Go the the FROM clause and create a derived table with a COALESCE
(foobar, '') in it, then do the rest of the query. Remember that
GROUPING() detect the NULLs created by the grouping set family and not
the original ones in the data.
Can I assume you really did not use "Categories" as a column name?
That is both vague and non-scalars. You also need to add some
constraints to the table so you don't keep doing this over and over,
year after year. Or have to clean up amess when you fail to correct
the data just once :(
.
- Follow-Ups:
- Re: WITH CUBE, Null and Empty string
- From: Simon Woods
- Re: WITH CUBE, Null and Empty string
- References:
- WITH CUBE, Null and Empty string
- From: Simon Woods
- WITH CUBE, Null and Empty string
- Prev by Date: Move historical data
- Next by Date: Re: Difference between "Unique Index" and "Primery key Index"?
- Previous by thread: Re: WITH CUBE, Null and Empty string
- Next by thread: Re: WITH CUBE, Null and Empty string
- Index(es):
Relevant Pages
|