WITH full_tabular as (
select json_query(atts, '$.EUPATH_0010077') as EUPATH_0010077
, json_query(atts, '$.CMO_0000289') as CMO_0000289
, json_query(atts, '$.EUPATH_0015125') as EUPATH_0015125
, ea.stable_id, rownum as r
from apidb.entityattributes ea
where ea.stable_id in ('4090009851_11jun08_find', '4079004161_10sep08')
)
select stable_id, EUPATH_0010077, CMO_0000289, EUPATH_0015125
from full_tabular where r > 0 and r < 20
;
sql, as per JB:
WITH full_tabular as ( select json_query(atts, '$.EUPATH_0010077') as EUPATH_0010077 , json_query(atts, '$.CMO_0000289') as CMO_0000289 , json_query(atts, '$.EUPATH_0015125') as EUPATH_0015125 , ea.stable_id, rownum as r from apidb.entityattributes ea where ea.stable_id in ('4090009851_11jun08_find', '4079004161_10sep08') ) select stable_id, EUPATH_0010077, CMO_0000289, EUPATH_0015125 from full_tabular where r > 0 and r < 20 ;