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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:53:18+00:00 2026-05-12T00:53:18+00:00

I have a nice DataGridView showing what is basically some kind of log data

  • 0

I have a nice DataGridView showing what is basically some kind of log data to the user.
The user can filter by district, region, settlement and street.
So far, the ComboBoxes are linked to each other, so at first only the district has values, and only after picking one, the region one is filled with the proper values, etc.

The new requirement is that all the list will only show values that actually exist in the log table. Meaning that if district 1 has 10 different regions, but only 2 of those appear in the data, I would show only those 2 regions. Sounds reasonable enough, especially for settlements and streets, where the ratio between total and used codes is much higher.
I thought of two major ways to do this.
First, I can filter with join:

select r.code, r.name
from Region r
join LogTable l on (r.code = l.regionCode)
where r.districtCode = :districtCode;

Or I can do this with a subselect:

select r.code, r.name
from Region r
where r.code in (select distinct l.regionCode
                 from LogTable l)
      and r.districtCode = :districtCode

A third option would be to start up with reading all distinct values of district, region, settlement and street on the logTaable, and then use the subselect option with a pre calculated “in” clause. That seems a bit less flexible, as new values entered after the initial reading will not be visible.

Is there any major difference between the ways? Or would both work just as well?

P.S. I don’t think there are any indexes set on the LogTable Code columns.

  • 1 1 Answer
  • 1 View
  • 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-12T00:53:18+00:00Added an answer on May 12, 2026 at 12:53 am

    If Oracle has a query analyzer you should run it on your three options. It will tell you which is fastest. It should also tell you if you need to add an index to LogTable.

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

Sidebar

Related Questions

In order to have nice clean urls with some kind of site archetecture I
I want to replace some headers by images, so I would have nice font.For
Is it possible to enable per-pixel lighting (so that I can have nice specular
I'm creating some kind of auction application, and I have to decide what is
I have a nice litte DataGridView, which gets loaded/populated by a button and a
I have a DataGridView that displays data from a MS Access database. I'm using
I'm using devise for user auth, but I have nice mockups for the signup,
I have some data, and I update it in a task: The app is
I have a asp.net website and i have nice urls so the user may
I am targeting 1.6 but I would like to have nice widget that can

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.