By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .

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 at 10 months ago * This page is subject to Site terms.

More from Kontext

local_offer teradata local_offer SQL

visibility 11
thumb_up 0
access_time 18 days ago

Extract sub string from a string is a common operation in data analytics. In Teradata, function SUBSTRING (SUBSTR) and REGEXP_SUBSTR are provided to achieve that. SUBSTR is used to extract string from a specified location while REGEXP_SUBSTR is used to extract string using regular expressions. ...

open_in_new View

local_offer teradata local_offer SQL

visibility 20
thumb_up 1
access_time 18 days ago

COALESCE function in Teradata returns NULL if all arguments evaluate to null; otherwise it returns the value of the first non-null argument. NULLIF is to used evaluate two expressions and returns NULL if the two arguments are equal otherwise if returns the first arguments. IS NULL i...

open_in_new View

local_offer teradata local_offer SQL

visibility 14
thumb_up 0
access_time 18 days ago

In SQL Server, TRY_CAST function returns a value cast to a specified data type is the cast is successful or null is the cast is not successful.  In Teradata, the equivalent function is TRYCAST. Code snippets -- return int 1030 SELECT TRYCAST('01030' AS int); -- retur...

open_in_new View

local_offer teradata local_offer SQL

visibility 5
thumb_up 0
access_time 18 days ago

From Teradata 16, LEAD and LAG OLAP functions are supported. The LAG function returns data from a row preceding the current row at a specified offset in a window group; the LEAD function accesses data from a row following the current row at a specified offset in a window group. Scenario ...

open_in_new View

info About author

Kontext Column

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward
info Follow us on Twitter to get the latest article updates. Follow us