Forum Replies Created

Viewing 15 posts - 4,111 through 4,125 (of 5,502 total)

  • RE: Querying a Table Using Dynamic SQL

    Did you look into ROW_NUMBER function (assuming you're using SQL2005)?

  • RE: Complex T-SQL query

    Please provide table def and rsample data in a ready to use format. For details on how to do that please see the first link in my signature.

    Furthermore, your code...

  • RE: Calculate Weighted Median

    Ok, here's what I came up with.

    It is imporant to understand the quirky update concept as well as the requirements that need to be fulfilled. So, I urge you to...

  • RE: Help with CASE statement in my query

    Kingston Dhasian (3/2/2010)


    Check if this works..

    SELECT*

    FROM cElements A

    LEFT JOIN sectionList D ON D.sectionID = A.sectionID

    LEFT JOIN fList E ON E.fID = D.fID

    WHERE

    1 = CASE

    WHEN '2006' IN(SELECT ...

  • RE: Calculate Weighted Median

    ashok_raja (3/3/2010)


    Hi

    Apoligize for the confusion..

    Here is what I want

    ID CODE Value Volume RunningTotal Average

    1 ...

  • RE: Using XML data as parameter in Stored Procedure

    miss.delinda (3/3/2010)


    Ok guys. Felt better now.

    For me, XML parameter will hurt performance it's a myth

    No it's not. And yes, it is.

    Like with any other tool/command/feature: if used wrong, it will...

  • RE: Using XML data as parameter in Stored Procedure

    To give an example of Adi's great explanation regarding the right place for the right tool:

    If you'd need to send 3 or 4 parameter to a procedure, then a comma...

  • RE: Be Responsible

    There's not only the person who's posting such data. There are people around in almost each and every forum who realize that those data seem to be real/production.

    So we should...

  • RE: Calculate Weighted Median

    ashok_raja (3/2/2010)


    Hi,

    Actually 46 will not be there as the next row will be for different ID

    i.e

    Insert into dr_temp(ID,Code,Value,Volume) Values(

    2,'120',31,2311)

    if present then Yes! it matches, I think Let's get the...

  • RE: Calculate Weighted Median

    ashok_raja (3/2/2010)


    Hi,

    Yep we can use the last one.

    Can this done in a SQL Query?

    Thanks

    It depends.

    Usually, a SQL query will rely on some logic requirement(s). If both results are possible,...

  • RE: Help with CASE statement in my query

    Why not joining the temp table directly to the query?

    Something like

    SELECT *

    FROM cElements A

    LEFT JOIN sectionList D ON D.sectionID = A.sectionID

    LEFT JOIN fList E ON E.fID =...

  • RE: Calculate Weighted Median

    It still is not really clear:

    280164.5 falls in the range b/w 106886 and 380683.

    But it also falls in the range b/w 179646 and 560329. Why not use that one?

  • RE: Calculating interest query

    Jeff Moden (3/2/2010)


    nathan 7372 (3/2/2010)


    Thats the funny thing about decimal places. Technically, you are both right. Obviously Jeff's higher precision datatype leads to a more mathematically accurate answer....

  • RE: Calculate Weighted Median

    Would you mind elaborate the business case?

    Especially the part

    falls b/w 106886 and 380683 but 380683 is greater than 280164.5 so the value is 45.

    Why do you compare the median...

  • RE: Help with CASE statement in my query

    What exactly are you trying to do here?

    Your "CASE WHEN '2006'..." (and all other similar case statements) don't really make sense. What variable/column is supposed to have a value of...

Viewing 15 posts - 4,111 through 4,125 (of 5,502 total)