Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select random 100 records in HP Vertica?

Tags:

sql

vertica

What function is used to select top 100 random records of a table in Vertica?

In Sybase we use something like

Select top 100 * from table_name a order by rand(rowid(a))
like image 214
user7600856 Avatar asked Sep 15 '25 08:09

user7600856


1 Answers

It's pretty similar:

select * from table_name a order by RANDOM() LIMIT 100 

There's that curious thing called a manual; it's full of little gems like this.

like image 80
mustaccio Avatar answered Sep 17 '25 23:09

mustaccio