Re: How to make a IN without a table... ?

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re: How to make a IN without a table... ?
Дата
Msg-id 3EE8610A.EBE8B77@rodos.fzk.de
обсуждение исходный текст
Ответ на How to make a IN without a table... ?  (David Pradier <dpradier@apartia.fr>)
Ответы Re: How to make a IN without a table... ?  (David Pradier <dpradier@apartia.fr>)
Список pgsql-sql
>
> i ran today in a problem when doing some (i mean too much for me)
advanced sql...
>
> What i want to do is something like this:
>
> SELECT
>       my_var1,
>       my_var2,
>       my_function(my_var1, my_var2)
> FROM (
>       SELECT
>               '1',
>               '2',
>               '3',
>               '4'
> ) AS my_var1_values,
> (
>       SELECT
>               '1',
>               '2',
>               '3',
>               '4'
> ) AS my_var2_values
>
> In short, i want to calculate the result of the function my_function
for
> some values of my_var1, cross by some values of my_var2.
> These values are not taken in a table, but put in directly.
> They are a lot, so i would prefer not to write the whole thing, line
> after line. (Let's say 10 values for the first, and 40 for the second
=>
> 400 lines of code to maintain...)
>
> I really don't see how to do this :-/
>
What about using a TEMP TABLE?
And COPY <temp-table> FROM STDIN offers a real fast way to populate.
BTW, why using SQL at all? Couldn't perl do the job much easier?
Regards, Christoph




В списке pgsql-sql по дате отправления:

Предыдущее
От: David Pradier
Дата:
Сообщение: How to make a IN without a table... ?
Следующее
От: Cedar Cox
Дата:
Сообщение: subselects - which is faster?