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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 244k
  • Answers 244k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I got similar errors before and it turned out that… May 13, 2026 at 8:07 am
  • Editorial Team
    Editorial Team added an answer Apparently not. See this article, which specifically states that Microsoft… May 13, 2026 at 8:07 am
  • Editorial Team
    Editorial Team added an answer I was able to get it working correctly by changing… May 13, 2026 at 8:07 am

Related Questions

I have a nice litte DataGridView, which gets loaded/populated by a button and a
So, I have a DataGridView using as datasource a BindingList DataGridView.DataSource = new BindingList<Car>{...}
I have been working on keeping things object oriented for my project. Currently, I'm
I want to start a job in a new thread or using backgroundworker to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.