Re: Random sort with distinct

From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: "Ozer, Pam" <pozer(at)automotive(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Random sort with distinct
Date: 2010-10-02 13:40:15
Message-ID: AANLkTimJi+TfKsuenpKcThuNfPpTrhW6j1kBXV1QsKzG@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hey Ozer,

How about dynamic queries?

2010/10/2 Ozer, Pam <pozer(at)automotive(dot)com>

> I have the following query
>
>
>
> Select Distinct VehicleMake, VehicleModel
>
> From VehicleYearMakeModelTrim
>
> Order by random()
>
> Limit 10;
>
>
>
> I don’t want to bring back the random number I just want the sort order to
> be random. How can I sort randomly? This query breaks because random() is
> not in the select.
>
>
>
> Thanks
>
>
>
> Pam
>
>
>
>

--
// Dmitriy.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Lee Hachadoorian 2010-10-02 13:42:29 Re: Random sort with distinct
Previous Message Ozer, Pam 2010-10-01 20:51:38 Random sort with distinct