From a2b498c291d9c21474f128f37c89482908bf35b0 Mon Sep 17 00:00:00 2001
From: Bruce Momjian Last updated: Mon May 26 15:25:04 EDT 2003 Last updated: Wed May 28 00:35:16 EDT 2003 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) See the FETCH manual page, or use
SELECT ... LIMIT....Frequently Asked Questions (FAQ) for PostgreSQL
-
@@ -83,7 +83,7 @@
4.1) What is the difference between binary
cursors and normal cursors?
4.2) How do I SELECT only the
- first few rows of a query?
+ first few rows of a query? A random row?
4.3) How do I get a list of tables or other
things I can see in psql?
4.4) How do you remove a column from a
@@ -799,7 +799,7 @@
description.4.2) How do I SELECT only the
- first few rows of a query?
+ first few rows of a query? A random row?
To SELECT a random row, use: +
+ SELECT col + FROM tab + ORDER BY random() + LIMIT 1; ++