Re: SQL-Statement
От | colin roald |
---|---|
Тема | Re: SQL-Statement |
Дата | |
Msg-id | 20030916200429.GF3848@moonbase.hopto.org обсуждение исходный текст |
Ответ на | SQL-Statement (Markus Espenhain <espenhain@etes.de>) |
Список | pgsql-admin |
Quoth Markus Espenhain <espenhain@etes.de>: > 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)
В списке pgsql-admin по дате отправления: