O'Reilly logo

Tera-Tom's 1000 Page e-Book on Teradata Architecture and SQL, 2nd Edition by Tom Coffing, William Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18 - The TOP Command

“Do not remove a fly from your friend's forehead with a hatchet.”

- Chinese Proverb

TOP Command

images

 

This is the TOP command. By putting TOP 3 before the column names, you are telling your system that you only want to see the top three rows on your report. This example brings back 3 random rows. That is not what makes the TOP command great. It becomes great when you ORDER BY the data.

TOP Command is brilliant when ORDER BY is used!

images

It is incredibly important to use an ORDER BY statement with your TOP Command. By ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required