Re: CVS to In_list without dynamic SQL, how?
От | Michael Moore |
---|---|
Тема | Re: CVS to In_list without dynamic SQL, how? |
Дата | |
Msg-id | CACpWLjPLBop8pgahenqt8m-V5Sc9dSJV=MRDCDVQ-qQtCVqDxA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: CVS to In_list without dynamic SQL, how? ("David G. Johnston" <david.g.johnston@gmail.com>) |
Ответы |
Re: CVS to In_list without dynamic SQL, how?
Re: CVS to In_list without dynamic SQL, how? |
Список | pgsql-sql |
Very nice!
In my case the value being compared is numeric. I tried:
SELECT to_char( 1 , '999') = ANY( string_to_array('1,2,3,4,5', ','));
SELECT to_char( 1 , '999') = ANY( string_to_array('1,2,3,4,5', ','));
but the result is FALSE
On Wed, Dec 9, 2015 at 12:19 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
DO $$declarecsv text := '''1'',''2'',''3''';v_var text;beginselect var into v_var from tx_vendor where vendor_key in csv;RAISE NOTICE 'result=(%)', v_var ;end$$;Obviously the above does not work, but hopefully explain what I am trying to accomplish.Thanks,MikeSELECT '1' = ANY(string_to_array('1,2,3,4,5', ','))David J.
В списке pgsql-sql по дате отправления: