[postmodern-devel] Converting a SQL statement with subquery into S-SQL

Sam Alves sam at oshean.org
Sat Dec 26 14:23:38 UTC 2009


Hi All,

I'm trying to make the following SQL statement lispy by converting it to
s-sql:

    SELECT * FROM filter

    WHERE title

    IN ( SELECT filter_title FROM user_filter WHERE user_id = 4);

Here's my best attempt:

    :SELECT '* :FROM 'filter

    :WHERE 'title

    :IN (:SELECT 'filter_title :FROM user_filter :WHERE (:= 'user-id 3))

However, I get the following error:

    Keyword WHERE takes exactly one argument

I've tried the SQL query in psql so I know it works, but I can't seem to
come up with an equivalent s-sql statement.

Thanks for any assistance,

Sam

-- 
Sam Alves
Package Maintainer
OSHEAN, Inc.
Email: sam at oshean.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/postmodern-devel/attachments/20091226/8a044c28/attachment.html>


More information about the postmodern-devel mailing list