Those select statements don't have the same number of records. For example, the first select only retruns a lable and the number of recrods; the second one is the real data extract. Is it possible to concatenate them together and export to one flat file?
You're talking to a database, so talk SQL. Concatenate? Translate that phrase into JOIN or UNION.
Build a SQL query which returns the result you request. Then use that same SQL in your export statement.
If repeating the table and no. of records is no problem:
Code:
SELECT TEMP1.TABLE,TEMP1.COUNTNO,TEMP2.* FROM
((SELECT TABLE AS TABLE,COUNT(*) AS COUNTNO FROM ..............
GROUP BY TABLE) TEMP1
CROSS JOIN
(SELECT ................. FROM ............) TEMP2)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.