Select top N records in SQL / Hive

visibility 14,630 access_time 3 years ago languageEnglish

In different databases, the syntax of selecting top N records are slightly different. They may also differ from ISO standards.

In Hive, use LIMIT N retrieve N records from the table. Remember to change N to an actual number.

Code snippet

SELECT * FROM TableName LIMIT N;
info Last modified by Raymond 3 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

timeline Stats
Page index 13.44
More from Kontext
BigQuery SQL - WITH Clause
visibility 428
thumb_up 0
access_time 2 years ago
PostgreSQL: Create and List User
visibility 100
thumb_up 0
access_time 8 months ago
Teradata - Update with Joins to Another Table
visibility 2,223
thumb_up 1
access_time 2 years ago