[Zope] Complex SQL query

José Monte josedomonte at hotmail.com
Fri Jan 14 15:42:12 EST 2005


Hit here.

I'v 2 databases (GadFly) that have different data.
I wish to join some data using a ZSQL method.

I have something like:

SELECT table1.colum1, table2.colum1
FROM table1, table2
WHERE table1.colum1 = table2.colum1

Until this step everything is working fine...
The problem appears when I want to compare the result of the above query 
(taht is working ok) with some data that only exists in the table2 and in 
table1.

I want to get some data from the table1 that I compare in table2 
(table1.colum1 = table2.colum1) and them I only want the data that the in 
the table1.colum1 is equal to 1 and 2 and in the table2 where above 0 (zero) 
in the colum2 and the colum3 < than the actual date.

I try to put something like:

SELECT table1.colum1, table2.colum1
FROM table1, table2
WHERE table1.colum1 = table2.colum1 AND table2.colum2 > 0 AND table2.colum3 
< <dtml-var expr="_.float(_.DateTime())"> AND table1.colum1 = 1 OR 
table1.colum1 = 2

This query is getting ZOPE to time out and it only works again with a 
restart...

Can anyone help me with this?

Thanks a lot,

  José Monte

P.S. - sorry for my extremely bad english.

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo



More information about the Zope mailing list