Re: select subquery
Fulvio Ciriaco <[email protected]> Fri, 17 Dec 2010 22:59:24 +0100
| Newsgroups | gmane.lisp.clsql.general |
|---|---|
| Message-ID | <87d3p0kqmb.wl%[email protected]> |
It is cl-sql 5.1.1 from debian squeeze repository. Fulvio At Thu, 16 Dec 2010 23:42:32 +0100 (CET), Harald Hanche-Olsen wrote: > > [Fulvio Ciriaco <[email protected]> (2010-12-16 21:59:45 UTC)] > > > 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. > > Is your clsql up to date? I think an older version had that problem. > Now I get this: > > CLSQL> (sql [select [a] :from [tablea] :where > [in [id] [select [c] :from [tableb]]] ]) > "SELECT A FROM TABLEA WHERE (ID IN (SELECT C FROM TABLEB))" > > - Harald