with great_design_tab as (
select 700 as id, '1,11,32,531' as ass_pain from dual union all
select 701 as id, '2, 44, 321' as ass_pain from dual
)
,usrs as (
select 1 as id, 'вася' as username from dual union all
select 11 as id, 'петя' as username from dual union all
select 32 as id, 'костя' as username from dual union all
select 531 as id, 'дима' as username from dual union all
select 2 as id, 'жора' as username from dual union all
select 44 as id, 'изя' as username from dual union all
select 321 as id, 'семен' as username from dual
)
select u.id, u.username, t.id
from usrs u
,great_design_tab t
,lateral (
select level x from dual
connect by regexp_substr(ass_pain, '[^,]+', 1, level) is not null
)
where u.id = trim(regexp_substr(ass_pain,'[^,]+', 1, x));
ID USERNAME ID
---------- -------- ----------
1 вася 700
11 петя 700
32 костя 700
531 дима 700
2 жора 701
44 изя 701
321 семен 701
create type t_varr is varray(100) of number;
create or replace function sum_varr(p_arr t_varr)
return number IS
v_res number;
begin
select sum(nvl(column_value,0)) into v_res
from table(p_arr);
return v_res;
end;
/
with t as (select 1 a, null b, null c from dual union all
select null a, null b, null c from dual union all
select null a, 2 b, 3 c from dual union all
select 5 a, 2 b, 1 c from dual)
select t.*, sum_varr(t_varr(a,b,c))
from t;
import { get } from 'lodash'
let link = get(msg, 'attachments[0].audio_message.link_mp3', '')
data = [........]
render() {
return (
<>
{ data.map(x => <MyComponent prop1={x.prop1} prop2={x.prop2} />) }
</>
)
}
data = [........]
render() {
const components = []
for(let i = 0; i < data.length; i++) {
const x = data[i]
components.push(<MyComponent prop1={x.prop1} prop2={x.prop2} />)
}
return (
<>
{ components }
</>
)
}
// вызовет initialize только когда догрузятся все скрипты defer:
document.addEventListener('DOMContentLoaded', initialize);