Hi Everyone,
I am using the in-DB tool to grab a massive data set from a database. While I am building the work flow I would like to limit the record to the top 100 for efficiency.
I see there is a SQL Editor that can be used, but unfortunately I do not know SQL at all. The black line provides the table name. I tried using TOP and LIMIT, but I feel I am using them in the wrong way.
Solved! Go to Solution.
Hey @cjsnets10, how did you try using TOP? Should look something like:
SELECT TOP (100) *
FROM <Insert Table Name>
@DataNath I tried and this came up
Hi @cjsnets10
Do you know which DB you are connecting with?
For example, using SQL Server you will do something like
Take a look at this link:
https://www.w3schools.com/sql/sql_top.asp
I am connecting to Vertica.
If you're using Vertica then it looks like you'll want to use LIMIT then: https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Statements/SELECT/LIMIT...
SELECT * FROM <Table Name Here>
LIMIT 100
From the documentation it looks like that will bring through a random 100 results each time you run the query and so if you want a consistent set of results you'll need something like:
SELECT * FROM <Table Name Here>
ORDER BY <Insert a field to order by>
LIMIT 100
@cjsnets10 Ok, so based on my previous response, i would take a look how this is done in Vertica and try something like this:
SELECT * FROM table LIMIT 100;
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |