🚀 News: We are launching the Kontext Labs AI-Native Data Intelligence Platform Pilot! Click here to join our pilot program.

Select top N records in SQL / Hive

2019-05-27 hive sql

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;