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 7910457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:52:28+00:00 2026-06-03T12:52:28+00:00

I’m using Connect By query to show hierarchical groups on a group, on this

  • 0

I’m using Connect By query to show hierarchical groups on a group, on this page I have a Combobox for selecting parent groups. But I want to hide all rows which contain group that currently being edited.

This is my table,

GROUPS
-------------
GROUP_ID, GROUP_NAME, GROUP_TYPE, PARENT_ID

My First query was;

SELECT * FROM 
(SELECT  
    GROUP_ID,
    LPAD('-',LEVEL,'-')|| GROUP_NAME GROUP_NAME,
     SYS_CONNECT_BY_PATH(GROUP_NAME, '->')  GROUP_NAME_PATH 
FROM  GROUPS
    START WITH PARENT_ID IS NULL AND TYPE='G'
    CONNECT BY PRIOR GROUP_ID=PARENT_ID)

This result was on grid.

27  -Generel Manager    ->Generel Manager,
28  --Project Manager   ->Generel Manager->Project Manager,
24  ---System Administrator ->Generel Manager->Project Manager->System Administrator
25  ---Software Developer   ->Generel Manager->Project Manager->Software Developer
26  ----Intern          ->Generel Manager->Project Manager->Software Developer->Intern

For example;

On page Editgroup.aspx?group_id=24
It shows all of these rows, but I want to hide all row paths which contains GROUP_ID = 24
because Group can not be selfchild.

I found a temporary solution with this query;

SELECT * FROM 
(SELECT  
    GROUP_ID,
    LPAD('-',LEVEL,'-')|| GROUP_NAME GROUP_NAME,
     SYS_CONNECT_BY_PATH(GROUP_NAME, '->') || ',' GROUP_NAME_PATH  
FROM  GROUPS
    START WITH PARENT_ID IS NULL AND GROUP_TYPE='G'
    CONNECT BY PRIOR GROUP_ID=PARENT_ID)
     WHERE  HIYERARSI_ID NOT LIKE '%,24,%'

24 is coming from url.

I think it won’t be an efficient solution in the future when we got big data.

How can I detect in a smarter whay the path contains this id or not?

  • 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-06-03T12:52:29+00:00Added an answer on June 3, 2026 at 12:52 pm

    Below code will remove group number 24 and all its children:

    SELECT   
    GROUP_ID, 
    LPAD('-',LEVEL,'-')|| GROUP_NAME GROUP_NAME, 
     SYS_CONNECT_BY_PATH(GROUP_NAME, '->')  GROUP_NAME_PATH  
    FROM  GROUPS 
    START WITH PARENT_ID IS NULL AND TYPE='G' 
    AND GROUP_ID <> 24 /* added condition */
    CONNECT BY PRIOR GROUP_ID=PARENT_ID 
    AND GROUP_ID <> 24 /* added condition */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.