1010 alink ="#0000ff ">
1111 < H1 > Frequently Asked Questions (FAQ) for PostgreSQL</ H1 >
1212
13- < P > Last updated: Mon May 26 15:25:04 EDT 2003</ P >
13+ < P > Last updated: Wed May 28 00:35:16 EDT 2003</ P >
1414
1515 < P > Current maintainer: Bruce Momjian (< A href =
1616 "mailto:pgman@candle.pha.pa.us "> pgman@candle.pha.pa.us</ A > )< BR >
@@ -83,7 +83,7 @@ <H2 align="center">Operational Questions</H2>
8383 < A href ="#4.1 "> 4.1</ A > ) What is the difference between binary
8484 cursors and normal cursors?< BR >
8585 < A href ="#4.2 "> 4.2</ A > ) How do I < SMALL > SELECT</ SMALL > only the
86- first few rows of a query?< BR >
86+ first few rows of a query? A random row? < BR >
8787 < A href ="#4.3 "> 4.3</ A > ) How do I get a list of tables or other
8888 things I can see in < I > psql</ I > ?< BR >
8989 < A href ="#4.4 "> 4.4</ A > ) How do you remove a column from a
@@ -799,7 +799,7 @@ <H4><A name="4.1">4.1</A>) What is the difference between binary
799799 description.</ P >
800800
801801 < H4 > < A name ="4.2 "> 4.2</ A > ) How do I < SMALL > SELECT</ SMALL > only the
802- first few rows of a query?</ H4 >
802+ first few rows of a query? A random row? </ H4 >
803803
804804 < P > See the < SMALL > FETCH</ SMALL > manual page, or use
805805 < SMALL > SELECT</ SMALL > ... < SMALL > LIMIT</ SMALL > ....</ P >
@@ -811,6 +811,14 @@ <H4><A name="4.2">4.2</A>) How do I <SMALL>SELECT</SMALL> only the
811811 records requested, or the entire query may have to be evaluated
812812 until the desired rows have been generated.</ P >
813813
814+ < P > To < SMALL > SELECT</ SMALL > a random row, use:
815+ < PRE >
816+ SELECT col
817+ FROM tab
818+ ORDER BY random()
819+ LIMIT 1;
820+ </ PRE >
821+
814822 < H4 > < A name ="4.3 "> 4.3</ A > ) How do I get a list of tables or other
815823 things I can see in < I > psql</ I > ?</ H4 >
816824
0 commit comments