on 04-28-2016 8:19 PM
Hi All,
I'm having issues using the string_agg function
'''value1'',''VALUE2'''
All values with in 2 single quotes seperated by comma and start and end with a single quote
I tried something like this
SELECT STRING_AGG("CODE",''',''') as code from (..select "code" from table)
O/p is value1,'value2
Is there is way to achieve this
Thanks
Hari,
the string_agg function in sqlscript is to concatenate strings...
the reason I did ',' was because I needed to concatenate strings in single quotes and separate them with a comma so I can use them in an IN clause...
something like this:
select string_agg("column", '','') into :var_str_agg from SOME_TBL;
select *
from SOMEVIEW
WHERE column IN (:var_strg_agg) or even if I used it with a parametized view, I can pass the :var_str_agg as the value that the placeholder is expecting
hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.