Re: My First Function - Mailing list pgsql-sql

From omid omoomi
Subject Re: My First Function
Date
Msg-id F194zSgDvai2RJ8m4ZQ0001b6eb@hotmail.com
Whole thread Raw
In response to My First Function  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Responses Re: My First Function  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
List pgsql-sql
>
>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.



pgsql-sql by date:

Previous
From: Gary Stainburn
Date:
Subject: My First Function
Next
From: "Josh Berkus"
Date:
Subject: WAL_FILES?