Re: Can I getting a unique ID from a select

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Timasmith <timasmith(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can I getting a unique ID from a select
Date: 2007-03-04 00:12:19
Message-ID: 20070304001219.GA19667@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 01, 2007 at 06:16:02 -0800,
Timasmith <timasmith(at)hotmail(dot)com> wrote:
> I am using hibernate, using a view like a read only table and I need a
> primary key each time a select is issued.
>
> create view myview as
> select rownum, t1.field, t2.field
> from tableOne t1, tableTwo t2
> where t1.key = t2.fkey
>
> select * from myview
>
> But what I really need is
>
> select makemeauniquekey, t1.field, t2.field
> ...

Is there some reason you can't use the join key?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Timasmith 2007-03-04 00:46:45 Re: Can I getting a unique ID from a select
Previous Message Shane Ambler 2007-03-03 21:29:37 Re: How Can I set a non standard date format?