Random sort with distinct

From: "Ozer, Pam" <pozer(at)automotive(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Random sort with distinct
Date: 2010-10-01 20:51:38
Message-ID: 216FFB77CBFAEE4B8EE4DF0A939FF1D10182C8@mail-001.corp.automotive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-10-02 13:40:15 Re: Random sort with distinct
Previous Message Dmitriy Igrishin 2010-10-01 14:37:05 Re: Question about PQexecParams