Forum Replies Created

Viewing 15 posts - 436 through 450 (of 582 total)

  • RE: Need help optimizing this Join Fest :)

    The left join and the IN clause don't cancel because they aren't necessarily looking at the same records. The IN clause check that the FE code of the opportuinty matches...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: USE OF STUFF

    declare

    @int int, @lpad int

    select

    @int = 31

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Coalesce and order by driving me up the wall

    What is the underlying data in dbo.allNames.Surname and dbo.allNames.initials for these 4 records?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Coalesce and order by driving me up the wall

    Well if Surname is not null, it' snot null. But a single null might not have the same effect under a different sort order, and you don't have a coalesce around...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Getting T-SQL to use LIKE, REPLACE, and IN... all at the same time???????????????????

    [And this is the first reply copied from the original site:]

    Hi A_Michigan_User,

     Erland has some techniques on his site to convert a comma-seperated

     string to a table with one value per row....

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need help optimizing this Join Fest :)

    IN returns on the first match, too. In fact I'm pretty sure that the two statements are regraded as eqivaluent by the optimiser.

    You still need to check the left joins...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Executing dynamic SQL string within a function

    You could put the code on the remote server (where the db list resides) and cahnge it to create a stored proc which could then be executed from yuor local server...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: How can I do this?

    In the full version of your query, are you retrieving any fields from BL_D?

    If not, are you using the join to BL_D to produce duplicate records in your result set? Since you...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need to sort Numbered Streets in Order

    A slight variant on the above that will extract a single block of numerals (<256) embedded in any string.

    Incidentally, the clumsiness of this approach highlights the fact that strictly speaking...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Requesting help creating ''''by month'''' summary query

    Or:
     
    select datename(m,datepart(m,monthdate)) [MONTH]

    , count(*)  [Number of Requests Completed]

    from MonthGroup

    group by datename(m,datepart(m,monthdate))

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: N-Many Relationship

    I believe you should 'fully' normalise your OLTP system and if the queries get too difficult/expensive, develop a reporting platform (data marts etc.,etc.,etc.). It's the best way in the long...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need help optimizing this Join Fest :)

    Here's a more user-friendly version. You need to check whether you need all those left joins. (I've got rid of one which was overridden by an equi-join...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Significant Digits

    Here's one way:

    declare

    @input table(fl float)

    --

    insert

    ...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Tough problem

    I thought the hash was granular enough that it wasn't worth either using a bigint or devising some fiendishly economical but unreadable hash algorithm.

    BTW, I've updated the code correcting...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Tough problem

    >I'm not sure what the point of the magnitude column is.
    >I can't come up with a pair of numbers which would have the same hash, but different magnitudes....

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

Viewing 15 posts - 436 through 450 (of 582 total)