Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I limit the number of rows returned in a Netezza query?

Tags:

sql

netezza

I want to run a basic query, but return only 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 of looking at just those few rows?

like image 213
mcpeterson Avatar asked Mar 19 '10 18:03

mcpeterson


People also ask

How do we limit which rows are returned by a query?

The SQL LIMIT clause restricts how many rows are returned from a query. The syntax for the LIMIT clause is: SELECT * FROM table LIMIT X;. X represents how many records you want to retrieve. For example, you can use the LIMIT clause to retrieve the top five players on a leaderboard.

How do I change the row limit in SQL?

You can easily change this limit by going to MySQL Workbench >> Edit >> Preferences >> SQL Queries tab. Over here you will option to Limit Rows. You can set this to very high value or uncheck the option.

Which keyword sets the maximum number of records to return?

The limit keyword is used to limit the number of rows returned in a query result.


1 Answers

Ah! Just found it.

For Netezza this query is

select a.*
  from some_schema.some_table a
 limit 10

-mcpeterson

like image 79
mcpeterson Avatar answered Oct 13 '22 01:10

mcpeterson