× 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.



Bradley V. Stone wrote:
Alan,

I was wondering if using a union on two files if I can construct a single
count(*) SQL command to count the total records from both files.
Brad, there are probably three or four ways to do what you're asking, but it will help if you give a business reason. For example, I can get you all the records from one file, followed by a row with the record count, then all the records from the second file, followed by a count. But remember that the result set must have the same columns in every row, so you end up with an additional column for the file name (which will be one of two values) and an addition column for the count (which will be zero for every records EXCEPT the two total records).

You can also do two queries, one which gets you all the detail, and a second which give you a single row with both counts (or two rows, each with a count and a filename).

It really depends on what you're going to do with the data.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.