× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 09 Sep 2013 09:44, Vern Hamberg wrote:
<<SNIP>> Someone else mentioned doing the totals with some reporting
tool. Otherwise, you have to use some "interesting" value like
9,999,999 to get the sort right when doing a UNION SELECT - and in
this case, you couldn't use a true date data type.

The database NULL value collates as an effective *HIVAL [and is valid for a date data type; of course ODLDAT is just CHAR(6)]. Any of the examples using 999999 for a contrived high-value for the 'MMDDYY' of the column ODLDAT would best have used the following expression, to have no particular value [a non-value] vs the invalid\contrived value:

CAST(NULL as CHAR(6))

And besides, the SQL OLAP capability introduced GROUPING SETS which "can be thought of as the union of two or more groups of rows into a single result set." Thus a typical query coding the UNION ALL query to get those rows, the equivalent OLAP query can be used instead. Specific grouping sets are available with CUBE and ROLLUP syntax.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.