Forum Replies Created

Viewing 15 posts - 241 through 255 (of 304 total)

  • RE: 'N' number of usage - Tally Table

    Jeff Moden (10/10/2008)


    ggraber (10/10/2008)


    Nope, I'm not 100% sure I know what you mean by a "Tally CTE." Sounds like you're gonna create a tally table on the fly. Which...

  • RE: Convert rows into columns

    Shree (10/9/2008)


    Jerry can you help me out to arrange them in one column?

    This would get the CSV

    DECLARE @Cities TABLE

    (

    State VARCHAR(20)

    ,City VARCHAR(20)

    )

    INSERT INTO @Cities

    SELECT 'Connecticut','Hartford'

    UNION ALL SELECT 'Connecticut','Stamford'

    UNION ALL SELECT 'Connecticut','New...

  • RE: 'N' number of usage - Tally Table

    Jeff Moden (10/8/2008)


    ggraber (10/8/2008)


    An article on this topic would be really cool, Jeff.

    I just presented this concept at work using your split csv example.

    I was just trying to think what...

  • RE: Swapping Columns

    Sorry, I didn't notice that. :blush:

  • RE: Swapping Columns

    Have you tried the UNPIVOT solution?

  • RE: 'N' number of usage - Tally Table

    I guess the question is that a while loop has a dynamic number of iterations based on the length of the parameter.

    You don't have that kind of flexibility with a...

  • RE: 'N' number of usage - Tally Table

    An article on this topic would be really cool, Jeff.

    I just presented this concept at work using your split csv example.

    I was just trying to think what other examples I...

  • RE: Swapping Columns

    Here's how to do it with UNPIVOT.

    Please note that I only used part of the table definition for this example.

    CREATE TABLE #mgr_calc

    (

    sID ...

  • RE: data selection

    Does this work for you?

    SELECT TM.SrcId AS Source

    ,TD.SrcId AS Destination

    ,TD.Category

    ...

  • RE: data selection

    Here's how to get the destination CabinetID. But I'm not sure about the source.

    Why doesn't TransferMaster have a Category?

    Can you please post a sample result set?

    SELECT TM.SrcId AS Source

    ,TD.SrcId AS...

  • RE: Using Multiple Select Statements in an Insert Statement

    If there really is no relationship between the tables then does that mean that the data in each field of each row of the final table is not related to...

  • RE: Cant show correct duplicate data using MAX function

    clint_pow (10/3/2008)


    Hi SSC,

    If I will do the MAX(Price), the data will get the MAX(Value) of the field, example

    1 4

    1 5

    2 ...

  • RE: Embedding function calls in a query

    I was thinking something like this.

    But it is not tested because you have not provided any sample data. 🙂

    Also, keep in mind that you can later join on the...

  • RE: Cant show correct duplicate data using MAX function

    clint_pow (10/2/2008)


    Hi SSC,

    Sorry I mean row if you take you example it will take like this :

    DocNum Price

    1 ...

  • RE: Return first record of each key

    Rich96 (10/2/2008)


    So true Vladen. I'm having to forge ahead with the ASSumption that it won't change.....

    You really do not have to (and should not) go with that assumption....

Viewing 15 posts - 241 through 255 (of 304 total)