pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: omid omoomi <oomoomi@hotmail.com>
To: gary.stainburn@ringways.co.uk
To: pgsql-sql@postgresql.org
Subject: Re: My First Function
Date: Sun, 01 Jul 2001 16:39:51
Message-ID: <F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.com> (raw)

>
>I want to be able to pass a member ID and a function ID and return the
>highest permission for the two.  The cut-down schema is:
>
Hello ,
Perhaps this SQL works for you:

select PPID,Max(PPERM)
from permtable
where
PFID = 'FUNCTION_ID'
and
PPID in ( select HPID from holdertable where HMID='MEMBER_ID' )
group by PPID;

You will face some problems returning more than one value from this SQL if 
using it in a function.
Though,I believe if you are going to use a PHP script it can easilly be 
handled with it.

Hope that helps
Omid Omoomi
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




view thread (6+ messages)  latest in thread

Message-ID: <F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.com>
Permalink:  ../F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.com/
Also on:    postgresql.org/message-id/F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.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: oomoomi@hotmail.com, gary.stainburn@ringways.co.uk
  Subject: Re: My First Function
  In-Reply-To: <F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.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