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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:43:41+00:00 2026-05-29T22:43:41+00:00

Some may or may not consider this a complex statement, but for me (since

  • 0

Some may or may not consider this a complex statement, but for me (since I’ve only been doing statement for about a month) this one is. The below statement returns me the exact results I am looking for, but my problem is that it take over 95 seconds to run on a iMac. I need this statement to run on an iPhone. Can anyone thing of a better (quicker) way to do this?

select categories.category  
from categories join categories_listings 
where categories_listings.category_id = categories.id
  and categories.association_id = 1 
  and (select count(*) 
       from (select (
                    select categories.category 
                    from categories left join categories_listings 
                    where categories_listings.category_id = categories.id
                      and categories.association_id = 1 
                      and listings.id = categories_listings.listing_id) as region 
             from listings left join chamber_specifics
               on chamber_specifics.listing_id=listings.id 
             where region = categories.category  
               and listings.association_id=1 
               and listings.status = 1 
               and downtown='Y')) >0 
group by categories.category;

Let me know if more info is needed.

Thanks!

  • 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-29T22:43:42+00:00Added an answer on May 29, 2026 at 10:43 pm

    I came up with a statement that gets me the same results as in my question, but much fast at about 0.062 seconds to complete. Below is my Statement: (Thanks Rudu for the direction!)

    select (
            select categories.category 
            from categories left join categories_listings 
            where categories_listings.category_id = categories.id  
            and categories.association_id = 1 
            and listings.id = categories_listings.listing_id) as region 
      from listings left join chamber_specifics 
        on chamber_specifics.listing_id=listings.id 
      where  listings.association_id=1 
      and listings.status = 1   
      and downtown='Y' 
    group by region
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class A { //some fields (may not only primitive types) and methods here}
Some of you may recognize this as Project Euler's problem number 11. The one
I have a directed cyclic graph. Some edges are FIXED and may not be
May be my title is not clear. I am looking for some kind of
That title may need some work. Perhaps after reading this, you may be able
Consider this scenario. I have some business logic that now and then will be
This may seem like a dumb question, but still I don't know the answer.
Consider this simplified view of some code with which I'm working: @Stateless(...) @Remote(...) @TransactionAttribute(TransactionAttributeType.MANDATORY)
I think I may have some confusion about the domain/service layer separation. In my
This may seem like a silly question, so bear with me... Consider this REPL

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.