Archives of the TeradataForum
Message Posted: Thu, 25 Mar 2004 @ 19:21:25 GMT
In my experience, you cannot get the total number of rows that will be returned without first doing a COUNT(*) (or something similar), and then executing your query. So you would need 2 queries.
If you are trying to LIMIT the rows that you will bring back, you could tack on 'SAMPLE 1000000' to the end of your query, to be assured that you would not get back more than a million rows. You could then inform the user that 'More than 1,000,000 rows have been returned, please change your query parameters' or something similar. If your result is LESS than a million rows, the SAMPLE command won't matter.
Hope this may (somewhat) help,
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|