Advertisement
rgruber

ipv4_prefixes,asn JSON_ARRAYAGG

Jul 2nd, 2022
1,327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.28 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement