Re: select subquery
Fulvio Ciriaco <[email protected]> Thu, 16 Dec 2010 22:59:45 +0100
| Newsgroups | gmane.lisp.clsql.general |
|---|---|
| Message-ID | <87ei9hl6pa.wl%[email protected]> |
Hallo,
thanks for the suggestion, but it was tried.
The problem is with the parenthesis:
select a from tablea where id in (select c from tableb)
- -
(clsql:select [a] :from [tablea] :where
[in [id] [select [c] :from [tableb]]])
translates to
select a from tablea where id in select c from tableb
which is incorrect sql.
Fulvio
At Thu, 16 Dec 2010 14:22:29 +0100 (CET),
Harald Hanche-Olsen wrote:
>
> [Fulvio Ciriaco <[email protected]> (2010-12-16 10:15:51 UTC)]
>
> > it is now some time I use clsql with postgresql, however
> > I could not discover how to put together an sql expression
> > like:
> > select a from tablea where id in (select c from tableb)
>
> I think
>
> (clsql:select [a] :from [tablea] :where
> [in [id] [select [c] :from [tableb]]])
>
> should work.
>
> - Harald