If you want to see which nodes this query would affect, run:
SELECT hostname, gateway_link_ipv4_id FROM maasserver_node WHERE gateway_link_ipv4_id NOT IN ( SELECT id from maasserver_staticipaddress);
If you want to see which nodes this query would affect, run:
SELECT hostname, gateway_ link_ipv4_ id FROM maasserver_node link_ipv4_ id NOT IN ( staticipaddress );
WHERE gateway_
SELECT id from maasserver_