Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6818411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:10:30+00:00 2026-05-26T21:10:30+00:00

I have a table Net where is the list of networks — Table: net

  • 0

I have a table Net where is the list of networks

— Table: net

CREATE TABLE net
(
  id serial NOT NULL,
  cidr cidr,
  description text,
  CONSTRAINT net_pkey PRIMARY KEY (id )
)

I need to select all the networks that do not. belong to other networks. ie only network without subnets. How to build a query?

cidr:
10.0.0.0/8
10.1.0.0/16
10.2.0.0/16
10.3.0.0/16
10.3.1.0/24
10.3.2.0/24
10.3.3.0/24
10.15.1.0/24
10.15.2.0/24
10.15.3.0/24
172.20.0.0/16
172.21.0.0/16
172.0.0.0/8
11.11.11.0/24
Top rated net is 10.0.0.0/8, 172.0.0.0/8, 11.11.11.0/24

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:10:30+00:00Added an answer on May 26, 2026 at 9:10 pm

    I understand your question like this:
    You want all network specifications that are not contained in any other network specification, i.e. are not part of the subnet of another.

    Try this:

    SELECT *
    FROM   net
    WHERE  NOT EXISTS (SELECT cidr FROM net n WHERE n.cidr >> net.cidr);
    

    Produces your expected result.
    Have a look at the chapter Network Address Functions and Operators in the manual for more on the >> operator.
    Semi-join with NOT EXISTS is probably the fastest way to do this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried with ado.net create table columnName with unique name. as uniquename I
I have a table in C# and ASP.net that references a list of another
I have a table of results in an ASP.Net MVC page where the last
I have dragged a empty asp.net table onto my webform. I generate all the
I'm working with .NET strongly-typed datasets and have a table with a nullable int
My application is in ASP.net MVC3. I have a table of elements. An element
Context: ASP.NET MVC 2.0, C#, SQL Server 2008, IIS7 I have 'scheduledMeetings' table in
I have the data table from the jquery plugin dataTables (http://datatables.net/) that I want
I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.