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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:43:54+00:00 2026-05-17T21:43:54+00:00

I have been having some trouble working with inner joins I guess: select count(distinct

  • 0

I have been having some trouble working with inner joins I guess:

select count(distinct id) 
  from svn1,
       svn2 
 where svn1.revno = svn2.revno 
   and svn1.type = 'Bug' 
   and svn2.authors IN (select authors 
                          from svn2 
                         where revno = '33')

How to make this faster with inner joins? My query with inner joins gives weird results.

Table Info for svn1:
Columns: id revno type
Data:
1 22 Bug
1 23 Change
1 24 Bug
2 33 Bug
2 34 Bug

Table Info for svn2:
Columns: revno authors
Data:
22 A
22 B
22 C
33 D
33 A
33 C

I want ids of type bug which have a common author with authors of revno 33. i.e ids which also have revno with authors A,D or C in it

In general I also want a query to answer give an id find other ids which have an authors in common.

  • 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-17T21:43:55+00:00Added an answer on May 17, 2026 at 9:43 pm

    You need something like this:

    select count(distinct id)
    from svn1 inner join svn2 on svn1.revno = svn2.revno
          inner join svn2 second on svn2.authors = second.authors
    where svn1.type='Bug' and and second.revno='33'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some trouble highlighting checkboxes and radio buttons that have been selected.
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
I have been having some problems trying to get my PHP running. When I
I having trouble in dividing the HTML frames. I have been using the following
I have been working with MVC 2 and it seems that at some point
I've been having some trouble with a set of dynamically created buttons in PyQT.
I've been having some trouble with Xcode. Every time I launch my application, it
Ive been having some trouble using Plot to graph a complicated composite function. I
I am having some trouble importing a class from a particular module. The class
Folks, I've been having some trouble with a WF4 problem. I'm modeling a batch

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.