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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:16:09+00:00 2026-06-09T01:16:09+00:00

I have: SELECT dv.VariableID , ds.DataSourceID , p.DataVariableDataSourceParamId , p.ParamCode , p.ParamDisplayName , p.DVDSParamControlType

  • 0

I have:

  SELECT  dv.VariableID ,
            ds.DataSourceID ,
            p.DataVariableDataSourceParamId ,
            p.ParamCode ,
            p.ParamDisplayName ,
            p.DVDSParamControlType ,
            p.DependentOnDVDSParamId ,
            pv.ParamValue
    FROM    dbo.DataVariable dv
            INNER JOIN dbo.DataVariableDataSource ds ON dv.DataSourceId = ds.DataSourceID
            INNER JOIN dbo.DataVariableDataSourceParam p ON ds.DataSourceID = p.DataSourceId
            INNER JOIN dbo.DataVariableDataSourceParamValue pv ON p.DataVariableDataSourceParamId = pv.DataVariableDataSourceParamId
    WHERE   dv.VariableID = @vid
    ORDER BY dv.VariableID

When I just have the first two joins, I get what I want: 6 results. When I add the third, I get 660. I just want the ParamValue for the 6 records from the first 2 joins and I can’t seem to figure out why this is breaking. I’m on my 12th hour of coding and I’m sure this is insanely obvious, but I could use a hand. Thanks in advance.

  • 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-09T01:16:11+00:00Added an answer on June 9, 2026 at 1:16 am

    This is going to be because you have numerous rows in your pv table that match on DataVariableDataSourceParamId

    You can verify by adding a SELECT DISTINCT. You may need to clean that table up or keep the distinct

    However, the distinct will only help if pv.ParamValue is the same for all, otherwise you are rightfully getting more matches as what is happening is that you are finding all the matches for DataVariableDataSourceParamId and displaying them. If all those matches are the same value, then the distinct will indeed help, though

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

Sidebar

Related Questions

Let's say we have: SELECT * FROM Pictures JOIN Categories ON Categories.CategoryId = Pictures.CategoryId
Let's say I have SELECT name FROM table which gives me something like foo
suppose I have SELECT * FROM table t GROUP BY j HAVING condition_one OR
I have a select list containing variables from a query <tr> <td>County Name:</td> <td>
Background : I have a GridView which gets populated from an SqlDataSource via DataSourceID.
I'm declaring a varchar variable in T-SQL declare @var varchar(max); I have a select
I have an array of variables all containing text. I want to select only
I have a method with at least 50 local variables. I need to select
I have something like the following code:: <xsl:variable name=sample> <xsl:copy-of select=//foo> <xsl:copy-of select=//bar> </xsl>
I have select: = f.select(:category_id, @categories, :html_options => {:class => 'select_box'}, {:disabled => true

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.