Skip to content

Instantly share code, notes, and snippets.

@chen1i
Created April 17, 2018 08:18
Show Gist options
  • Save chen1i/00bdbb06eeb414ce1cfd7b28d09b1ee6 to your computer and use it in GitHub Desktop.
Save chen1i/00bdbb06eeb414ce1cfd7b28d09b1ee6 to your computer and use it in GitHub Desktop.
extract JSON field in mysql table
select ddn.properties->>'$.server.name' as os_hostname,
ddni.external_name,
ddni.host_instance_name,
ddni.name,
ddni.runtime_properties->>'$.ip' as main_ip
from deployment_details_node ddn,
deployment_details_node_instance ddni,
deployment dp
where dp.tenant_id = 'bocomm'
and dp.deleted =false
and ddn.`type` like '%Server'
and ddn.deployment_id = dp.id
and ddni.deployment_details_node_id = ddn.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment