Re: Can I getting a unique ID from a select

From: "Timasmith" <timasmith(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can I getting a unique ID from a select
Date: 2007-03-04 00:46:45
Message-ID: 1172969204.965508.210800@v33g2000cwv.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 3, 7:12 pm, b(dot)(dot)(dot)(at)wolff(dot)to (Bruno Wolff III) wrote:
> On Thu, Mar 01, 2007 at 06:16:02 -0800,
> Timasmith<timasm(dot)(dot)(dot)(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?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/

Never heard of a 'join key' but that sounds very promising. How do I
select it?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Rosenberg 2007-03-04 02:20:44 Configure can't find com_err on OpenBSD for --with-krb5
Previous Message Bruno Wolff III 2007-03-04 00:12:19 Re: Can I getting a unique ID from a select