From: | Margarita Barvinok <brita(at)math(dot)lsa(dot)umich(dot)edu> |
---|---|
To: | Michael Meskes <Michael_Meskes(at)topmail(dot)de> |
Cc: | PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | Re: [INTERFACES]- SELECT statement |
Date: | 1999-02-26 14:23:04 |
Message-ID: | Pine.SOL.3.96-4hack.990226091940.8996A-100000@bailey.math.lsa.umich.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Dear Michael,
Thank you very much.
-Margarita
On Thu, 25 Feb 1999, Michael Meskes wrote:
> On Thu, Feb 25, 1999 at 09:26:50AM -0500, Margarita Barvinok wrote:
> > 1)
> > How can I realize this query in C-Embedded SQL?
> >
> > SELECT MAX (score)
> > FROM report
> > WHERE uname = 'xxxxxxx'
> > AND exam_id IN
> > ( SELECT exam_id
> > FROM exam
> > WHERE name = 'yyyy'
> > )
>
> exec sql declare C cursor for SELECT MAX (score)
> FROM report
> WHERE uname = 'xxxxxxx'
> AND exam_id IN
> ( SELECT exam_id
> FROM exam
> WHERE name = 'yyyy'
> );
>
> exec sql fetch in C into :score;
>
> > I used DECLARE CURSOR and FETCH for second SELECT statement.
> > But I don't know how to use WHERE ... IN clause.
>
> This is one statement. The subselect is handled by the backend.
>
> Michael
> --
> Michael Meskes | Go SF 49ers!
> Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
> Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
> Email: Michael(dot)Meskes(at)gmx(dot)net | Use PostgreSQL!
>
From | Date | Subject | |
---|---|---|---|
Next Message | Patrice DUMAS | 1999-02-26 14:49:22 | undefined reference to crypt |
Previous Message | Byron Nikolaidis | 1999-02-26 14:05:21 | Re: Access problems |