Advertisement
rgruber

ipv4_prefixes,asn JSON_ARRAYAGG

Jul 2nd, 2022
967
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT a.asn,JSON_ARRAYAGG(JSON_OBJECT('prefix',a.prefix,'name',pfname,'description',pfdescr,'country_code',cc,'parent',JSON_OBJECT()) )  ipv4_prefixes FROM _riswhois1 a
  2. JOIN prefixes b ON a.i1=b.i AND a.prefix=b.prefix
  3. WHERE a.asn IN (1901,8447,8412,6830,3320)
  4. GROUP BY a.asn;
  5.  
Advertisement
RAW Paste Data Copied
Advertisement