pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lee Hachadoorian <lee.hachadoorian@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Random sort with distinct
Date: Sat, 02 Oct 2010 09:42:29 -0400
Message-ID: <4CA736C5.5080606@gmail.com> (raw)
In-Reply-To: <216FFB77CBFAEE4B8EE4DF0A939FF1D10182C8@mail-001.corp.automotive.com>
References: <216FFB77CBFAEE4B8EE4DF0A939FF1D10182C8@mail-001.corp.automotive.com>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
This runs fine on my 8.4 install. What version are you using and what
error message are you getting?<br>
<br>
--Lee<br>
<br>
On 10/01/2010 04:51 PM, Ozer, Pam wrote:
<blockquote
 cite="mid:216FFB77CBFAEE4B8EE4DF0A939FF1D10182C8@mail-001.corp.automotive.com"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <meta name="Generator" content="Microsoft Word 12 (filtered medium)">
  <style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
-->
  </style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="WordSection1">
  <p class="MsoNormal">I have the following query<o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
  <p class="MsoNormal">Select Distinct VehicleMake, VehicleModel<o:p></o:p></p>
  <p class="MsoNormal">From VehicleYearMakeModelTrim<o:p></o:p></p>
  <p class="MsoNormal">Order by random()<o:p></o:p></p>
  <p class="MsoNormal">Limit 10;<o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
  <p class="MsoNormal">I don&#8217;t want to bring back the random number I
just
want the sort order to be random. How can I sort randomly?&nbsp; This query
breaks
because random() is not in the select.<o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
  <p class="MsoNormal">Thanks<o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
  <p class="MsoNormal">Pam<o:p></o:p></p>
  <p class="MsoNormal"><span
 style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><br>
  <br>
  </span><o:p></o:p></p>
  </div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Lee Hachadoorian
PhD Student, Geography
Program in Earth &amp; Environmental Sciences
CUNY Graduate Center
</pre>
</body>
</html>



view thread (5+ messages)  latest in thread

Message-ID: <4CA736C5.5080606@gmail.com>
Permalink:  ../4CA736C5.5080606@gmail.com/
Also on:    postgresql.org/message-id/4CA736C5.5080606@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lee.hachadoorian@gmail.com
  Subject: Re: Random sort with distinct
  In-Reply-To: <4CA736C5.5080606@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox