<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Melding</TITLE>

<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=583121620-06092004>I'm trying to run 
this SQL statement:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=583121620-06092004>"SELECT&nbsp;s1 
FROM&nbsp;t1 WHERE&nbsp;s1 NOT IN (SELECT&nbsp;s1 FROM&nbsp;t2 WHERE&nbsp;s2 = 
&lt;dtml-sqlvar&nbsp;s2 type="int"&gt;)",</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=583121620-06092004>but zope gives the 
error message:</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=583121620-06092004><STRONG>Error, 
<EM>_mysql_exceptions.ProgrammingError</EM>:</STRONG> (1064, "You have an error 
in your SQL syntax. Check the manual that corresponds to your MySQL server 
version for the right syntax to use near 'SELECT&nbsp;s1 FROM&nbsp;t2 
WHERE&nbsp;s2 = 2) LIMIT 1000")</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=583121620-06092004>What i want to do is list all values 
of s1 in table 1 which isnt found in table 2 rows where s2&nbsp; some dynamic 
value.</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=583121620-06092004>If i run the subquery only it works 
fine.</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=583121620-06092004>Any 
suggestions?</SPAN></FONT></DIV></BODY></HTML>