Quoth Markus Espenhain <[EMAIL PROTECTED]>:
> SELECT * FROM Hauptantrag WHERE (select datenfeldname from
> datenexport) > (select datum_von from datenexport) AND (select
> datenfeldname from datenexport) < (select datenexport.datum_bis from
> datenexport) limit 10;

If I understand you right, you want to compare some column from 
Hauptantrag to a range of values (datum_bis < 'some column' < datum_von),
but you don't know what the column will be ahead of time.

I believe this requires a dynamic sql statement, such as the plpython
command 'execute':

rv = plpy.execute(
        "SELECT * FROM Hauptantrag WHERE %s > %f AND %s < %f" 
        % (colname, datum_von, datum_bis), 
        10)

If you can, it's probably best to rework the logic of your code to 
avoid having to test unknown columns.  


--
colin | perfection is reached, not when there is no longer anything to add, 
roald | but when there is no longer anything to take away. 
                                                 (antoine de saint-exupery)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to