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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:21:24+00:00 2026-06-11T06:21:24+00:00

Till today my thoughts about the inner join were it will return the minimum

  • 0

Till today my thoughts about the inner join were it will return the minimum number of rows that exist in tables satisfying a joining condition.

Ex. if table A contains 4 rows and table B contains 7 rows . i was expecting that 4 rows can be the maximum output if they satisfy the joining condition.

I just wrote an sp in which i was creating two temporary tables and was populating them. then i took an inner join of them but returning more rows (In my case 29 rows were returned i was expecting 4)
After some search i found this
link

which confirms that i can happen but i still wonder what are my options to limit the returned result.

Below is my stored procedure.

ALTER PROCEDURE [dbo].[GetDDFDetailOnSiteCol]
@siteId int,
@colNum int
AS
BEGIN
SET NOCOUNT ON;

create Table #portDetail
(
ddfId int,
portDetail nvarchar(50),
siteId int
)
Insert into #portDetail SELECT  ddf.id,  ddf.portDetail, site.Site_ID  from site
        inner join ddf ON site.Site_ID = ddf.siteCodeID 
        where ddf.siteCodeID = @siteId and ddf.colNo= @colNum
        order by colNo,blockNum,portRowNum,portColNum

create Table #portAllocationDetail
(
assigned_slot nvarchar(50),
siteId int
)
Insert into #portAllocationDetail 
SELECT  dbo.portList.assigned_slot, dbo.site.Site_ID
FROM dbo.portList INNER JOIN
 dbo.site ON dbo.portList.siteCodeID = dbo.site.Site_ID
 where dbo.site.Site_ID = @siteId

--select * from #portAllocationDetail   
Select #portDetail.ddfId,#portDetail.portDetail,#portAllocationDetail.siteId,#portAllocationDetail.assigned_slot FROM #portDetail 
INNER JOIN #portAllocationDetail 
ON
#portDetail.siteId = #portAllocationDetail.siteId
END
  • 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-11T06:21:26+00:00Added an answer on June 11, 2026 at 6:21 am

    An inner join repeats each matching row in TableB for each row in TableA. So if there are 4 rows in TableA, and 7 in TableB, the maximum rowcount is 28.

    Example at SQL Fiddle.

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

Sidebar

Related Questions

Till yetsterday everything was working fine on my iPhone. Starting today, I noticed that
I have a big problem. I had a configuration which worked properly till today.
Up till now I've used version control for simple web-based projects that don't really
I am php page everything was working fine till today morning. Now the page
Today I decided to come up with a program that would be useful for
Simple question today: Is it better to return query data in a struct or
till today when i was working with MySQL and needed to perform actions with
I have been working in a project that have been working wothount problems till
I have created an app and it was running successfully till yesterday, by today
Till recently, I was under the impression that if you detach a thread after

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.