Forum Replies Created

Viewing 15 posts - 1,141 through 1,155 (of 1,473 total)

  • RE: The Reverse Optimization Challenge #1

    GilaMonster (11/10/2008)


    Garadin (11/10/2008)


    Correlated subqueries CAN (I believe the optimizer sometimes converts them to joins / derived tables for you) be run Row by Row, which is very slow.

    More...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: stored procedure is not working

    Johann Montfort (11/10/2008)


    i posted sample data

    Not really. You posted a big blob of text. Read the post Hodgy tried to point you to (also in my signature) for...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: The Reverse Optimization Challenge #1

    Added in the two extra calculations I had only comments for in my original query as correlated subqueries... one as a CASED correlated subquery.

    Temporarily removed the Windowed function and the...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: UPDATE Name field

    That would just be an update statement with a join:

    UPDATE tbl_DEMOG1

    SET Name = D2.Name

    FROM tbl_DEMOG1

    INNER JOIN tblDEMOG2 D2 ON tblDEMOG1.PatID = D2.patID

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Temp table

    Please refer to the post in my signature for an example of how you can supply table DDL and sample data. Provide that information, with the result you're looking...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: passing parameters on a form - sql - to generate a report

    For starters, you don't need to nest your inner joins. It makes them a LOT easier to read and work with when you do something like this (You can...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: A simple OUTER JOIN - not so much

    Ugh. That was actually the first thing I tried... I just didn't join on date in addition to emplID and it wasn't giving me what I wanted. Barry...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: A simple OUTER JOIN - not so much

    Please refer to the link in my signature for a better way to provide sample data in future posts. Try this:

    [font="Courier New"]

    SELECT DISTINCT

       COALESCE(H1.EmplID,M.EmplID) EmplID,

       COALESCE(H1.SurName,M.SurName) SurName,

      ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: This code should not work!

    Your friday afternoon stumper is way better than mine :ermm:.

    I can tell you it's the order by on a field from a table you're not actually selecting from that allows...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SELECT WHERE NOT IN query

    Matt:

    Thanks, that makes sense. I thought it might be something like that, but that definitely makes it more clear.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SELECT WHERE NOT IN query

    Lynn,

    That runs fine, and gives the 12K rows expected. There's no reason I couldn't have done it that way, it was just blowing my mind that the...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: SELECT WHERE NOT IN query

    @Lowell:

    That's what I ended up doing to fix it, but I still don't fully understand why it should be necessary. Could you explain why a single NULL invalidates my...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Trigger that uses a Parameter with Inserted/Deleted

    They're not so much thrown... as launched. Throwing a pork chop just sounds ridiculous... I mean, who does that, pork chops are delicious... you don't want to just throw...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Divide by zero error encountered

    Kishore.P (11/7/2008)


    use COALESCE function instead of IsNull or NullIf.

    You can make an argument for using it instead of ISNULL, but NULLIF doesn't do the same thing as coalesce.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: inner join issue

    Group by is normally used for aggregates. To be honest, I don't need it in those queries, I just wrote them in a hurry and had originally planned on...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 1,141 through 1,155 (of 1,473 total)