Bradley V. Stone wrote:

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.


This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].