What is the difference between "TOP" and "SAMPLE" in TeraData SQL? Are they the same?
What is the difference between "TOP" and "SAMPLE" in TeraData SQL? Are they the same?
‘Sample’ command:
Sel * from tablename
sample 100
That will give you a sample of 100 different records from the table. The SAMPLE command will give DIFFERENT results each time you run it.
TOP command:
sel top 100 * from tablename;
This will give the first 100 rows of the table. The TOP command will give you THE SAME results each time you run it.