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

The Archive Base Latest Questions

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

SELECT C.* FROM Content C INNER JOIN ContentPack CP ON C.ContentPackId = CP.ContentPackId AND

  • 0
    SELECT C.* 
      FROM Content C
INNER JOIN ContentPack CP ON C.ContentPackId = CP.ContentPackId 
                         AND CP.DomainId = @DomainId

…and:

    SELECT C.* 
      FROM Content C
INNER JOIN ContentPack CP ON C.ContentPackId = CP.ContentPackId
     WHERE CP.DomainId = @DomainId

Is there any performance difference between this 2 queries?

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

    Because both queries use an INNER JOIN, there is no difference — they’re equivalent.
    That wouldn’t be the case if dealing with an OUTER JOIN — criteria in the ON clause is applied before the join; criteria in the WHERE is applied after the join.

    But your query would likely run better as:

    SELECT c.* 
      FROM CONTENT c
     WHERE EXISTS (SELECT NULL
                     FROM CONTENTPACK cp
                    WHERE cp.contentpackid = c.contentpackid
                      AND cp.domainid = @DomainId)
    

    Using a JOIN risks duplicates if there’s more than one CONTENTPACK record related to a CONTENT record. And it’s pointless to JOIN if your query is not using columns from the table being JOINed to… JOINs are not always the fastest way.

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

Sidebar

Related Questions

SQL query: SELECT ArticleCategories.Title AS Category, Articles.Title, Articles.[Content], Articles.Date FROM ArticleCategories INNER JOIN Articles
The sql statement is like this: select posts.id, posts.title from posts inner join (select
When I try this: SELECT * -- INTO DB2.dbo.CustomerOrderLines FROM DB1.dbo.CustomerOrderLines INNER JOIN DB1.dbo.CustomerOrders
I have two mysql queries: $sql = SELECT * FROM content WHERE threadName LIKE
What am I doing wrong with this: $sql = SELECT * FROM content WHERE
SELECT T.clinic_code, C.dt, T.schedule_time, T.section_name, T.section_content, CS.schedule_event_source_id FROM Master_Templates T INNER JOIN Calendar C
The sql query: select id,title from blog_post inner join (select object_pk, max(submit_date) from django_comments
SELECT avg(con_hits) as avg_hits FROM content WHERE con_type = 1 AND con_posttime < $twelve_hrs_ago
Hi can anyone help me how to select a specific div from the content
if i apply a sql query statement to this table select * from context.tablename,

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.