Forum Replies Created

Viewing 15 posts - 106 through 120 (of 134 total)

  • RE: Update table using Group By

    It seems from the wording of your original post that you may want this to be a computed column in a permanent table. Unfortunately, window functions cannot be part of...

  • RE: SQL Report formatting with UNION Clause

    I believe this is not so much a question of grouping data as it is in presenting it. It would appear you want the left two columns sorted by GroupID...

  • RE: datetime comparison behaving oddly

    I did some checking on a small sample of data (included with a solution below), and I discovered that the OBSValue works just fine as a datetime value in the...

  • RE: Recursive CTE

    Here is a new query with two CTEs: the first finds all the ancestors of the selected client; the second CTE finds all the descendants of the top ancestor in...

  • RE: Recursive CTE

    First, let me point out that I understand "Link_Client_ID" to mean "the client of the current person" and not the other way around. In other words the first row of...

  • RE: Pivot and grouping question

    You really only need one CTE to rank the data, and then in the main query use a combination of aggregate functions and CASE statements to pivot the results into...

  • RE: Recursive CTE

    I made the following tweaks to your CTE to give what I hope is a better result:

    1. Fixed the main problem, which was that the anchor member of the "child"...

  • RE: filter duplicate students via T-SQL

    sdhanpaul,

    The problem with the "group by" approach you propose is that it defines a duplicate row as that shares values in all the columns Student AND IDNo AND Tel3 AND...

  • RE: filter duplicate students via T-SQL

    I've continued to scratch my head over this one, and I think I have a better solution now. What was troubling me is the fact that there is no good...

  • RE: filter duplicate students via T-SQL

    Sergiy,

    I apologize for overlooking that detail of your script. Your script does identify the names with a duplicate entry by isolating the "known" ID values from the "unknown" ID values;...

  • RE: filter duplicate students via T-SQL

    After reading through the thread, I see that none of the solutions offered thus far have recognized the necessity of treating the rows with a known IDNo differently than the...

  • RE: nested left and right query?

    I read the thread from your original post, and so far the emphasis has been on finding alternatives to LEFT and RIGHT, but your original question was just about the...

  • RE: How to Relate a Snowflake Dimension to the primary Dimension

    I think I finally figured out why it is acceptible to use the surrogate key for the many-to-many relationship between dimensions like my dimNames and dimAddresses dimensions. It is because...

  • RE: How to Relate a Snowflake Dimension to the primary Dimension

    That is not unlike how the many-to-many relationship is handled in the OLTP database from which I am pulling the data. In this approach every time a new Type 2...

  • RE: How to Relate a Snowflake Dimension to the primary Dimension

    I'm not sure how a factless fact table would differ from a snowflake dimension in terms of the actual table structure. But even if I pursue this approach, I am...

Viewing 15 posts - 106 through 120 (of 134 total)