Subnets.sql 553 B

12345678910111213141516
  1. /* syntax version 1 */
  2. SELECT
  3. subnet1 AS internal1,
  4. Ip::SubnetToString(subnet1) AS string1,
  5. Ip::SubnetMatch(subnet1, subnet2) AS subnet1_subnet2_match,
  6. Ip::SubnetMatch(subnet1, ip1) AS subnet1_ip1_match,
  7. Ip::SubnetMatch(subnet2, ip1) AS subnet2_ip1_match,
  8. Ip::ToString(Ip::GetSubnetByMask(ip1, ip2)) AS ip1_ip2_mask_subnet
  9. FROM (
  10. SELECT
  11. Ip::SubnetFromString(subnet1) AS subnet1,
  12. Ip::SubnetFromString(subnet2) AS subnet2,
  13. Ip::FromString(ip1) AS ip1,
  14. Ip::FromString(ip2) AS ip2
  15. FROM Input
  16. );