What is the netezza ronum equivalent? Or how do you take the "head" of a netezza table in netezza sql?

I want to run a basic query, but only return the first ten rows of the table from Netezza

select a.* from some_schema.some_table a where rownum < 10 

What is the Netezza way to view only a few lines?

+6
sql netezza
source share
3 answers

Oh! Just found.

For Netezza, select this request. * From some_schema.some_table a limit 10

-mcpeterson

+7
source share

The following query should work for any random "N" rows in the netezza table.

 SELECT COLNAME1 FROM ( SELECT COLNAME1 FROM SCHEMANAME..TABLENAME ORDER BY COLNAME1 LIMIT n) A MINUS SELECT COLNAME1 FROM ( SELECT COLNAME1 FROM SCHEMANAME..TABLENAME ORDER BY COLNAME1 LIMIT m) B 

Note: n> m (m, n are integers)

+2
source share
 SELECT * FROM schema_name..table_name LIMIT 100 OFFSET 50 

LIMIT is the number of records you need, and OFFSET is what you need to calculate!

+2
source share

All Articles