Forum Replies Created

Viewing 15 posts - 5,596 through 5,610 (of 7,164 total)

  • RE: Handle NULLs

    Here is the code including the latest string manipulation approach from tommyh and a variation of the "Union All/Crosstab" approach I put together, both of which remove dups yet still...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: No error for missing Linked Server?

    Sorry for your troubles Craig...your avatar <edit>your old avatar anyway :-)</edit> is very fitting on this thread 😀

    I have fought with missing or incorrect Linked Servers in non-prod environments and...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    tommyh (7/8/2011)


    A question which i hope someone might be able to answer about the "Union/Cross tab" solution.

    Okay so lets say we have a result looking like 1, "Tennis", Null,...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    mikes84 (7/8/2011)


    Regarding these two requirements mikes84:

    1) Do you want duplicates shown in the results?

    2) Does order matter?

    Using our two tables hobby1 and hobby2 here is an example that should answer...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    I have some re-thinking to do and some more learning to do from your work Jeff...I had suspicions before but it is abundantly clear to me now just how bad...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: SQL Grouping Data

    ringovski (7/7/2011)


    David Burrows (7/7/2011)


    1. where in the code do I put the alias i need for the column names, eg. issue date as Invoice Date.

    Just add the alias to the...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    mister.magoo (7/7/2011)


    mikes84 (7/6/2011)


    I have a situation where I'm querying two tables, each that has up to two hobbies listed. The first table has hobby1 and hobby2, and the second table...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    Nevyn (7/7/2011)


    Please someone tell me what I did wrong:

    You had a typo in your solution (used hobby1 twice from the first table), but that wouldn't effect the performance.

    <edit>I think I...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Same statements, different plans?

    Dang...it was sniffing! As soon as I added a set of local variables to the proc and set them to the value of the input parameters I started getting the...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    mikes84 (7/7/2011)


    opc, what about this for the PARSENAME method?

    SELECT h1.id,

    REVERSE(PARSENAME(REVERSE(REPLACE(RTRIM(

    CASE WHEN h1.hobby1 IS NULL THEN '' ELSE h1.hobby1 + ' ' END +

    CASE WHEN h1.hobby2 IS NULL THEN...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    mikes84, could you edit your post so the code has some line breaks in it? It's making the page reallllly wide.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    I upped the ante to see how each technique would really do when presented with more than 5 rows of data in each table and in the process I broke...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Handle NULLs

    I'd love to hear from the OP again 🙂 Are you out there mikes84?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: ANSI Padding In Only Some of Result Rows for Joined Table

    I just went for a generic POC...the concept should still apply. I am super-curious now about your comment regarding select * vs. a named column list. Please provide DDL, DML...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Filter using a datetime field

    lgoolsby 86333 (7/7/2011)


    opc.three (7/7/2011)


    What's wrong with comparing it to the result of the function call you used to populate PERIOD?

    CONVERT(VARCHAR(6), tableB.INV_SER_DTs, 112)

    This is exactly what I was trying but having...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 15 posts - 5,596 through 5,610 (of 7,164 total)