Getting different record count from same query

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Enthusiast

Getting different record count from same query

My Teradata SQL query is returning different record count for the same query . When running again and again, count is varying, what can be the issue. Even when running within a minute count is changing.

Can some help in understanding this issue?

 

FYI,tables that I am joining are not being updated/refreshed.

 

 

Regards,
Mayank
3 REPLIES
Junior Contributor

Re: Getting different record count from same query

There might be some RANDOM usage or some OLAP functions without a uinque ORDER BY, hard to tell without the actual source code.

Enthusiast

Re: Getting different record count from same query

The whole SQL is of around 2000 lines with multiple volatile tables being created in between. Can you help me what should I look for in SQL in order to root cause of issue?

Regards,
Mayank
Junior Contributor

Re: Getting different record count from same query

Any occurance of RANDOM (or any non-deterministic UDF created on your system) or OLAP-functions used in QUALIFY based on a non-unique ORDER BY.