Forum Replies Created

Viewing 15 posts - 346 through 360 (of 4,080 total)

  • RE: Doing a Range Scan on a composite index

    Wait, I missed this.

    CREATE UNIQUE INDEX IX_IX ON Table (Col1, Col2)

    You're only skipping rows 1-8 where col1 = 10

    Unless you go up to thousands of values in...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Doing a Range Scan on a composite index

    I'd want to compare execution plans because this is clunkier lookin, but you might also try

    SELECT ... WHERE Col1 = @Param1 AND Col2 > @Param2

    UNION ALL

    SELECT...WHERE...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Do Not Return Matching Rows

    Pssst... "MIAMI"

    Also, I'm missing something.

    Why not just select where [Statename] <> 'ALL' ?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Help with a PIVOT

    VALUES is not a table. It is a table value constructor, because the values clause can contain expressions which are used to construct the actual values produced. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Finding Friends and Mutual Friends.

    Two examples:

    (1) A is friends with B who is a friend of C. B is a mutual friend.

    (2) A is friends...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: get the price of last buy of each sell

    Agreed

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: get the price of last buy of each sell

    Drew, the pattern of this data is what I think of as header/detail data. One very significant "S" row followed by a bunch of "B" rows. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: SQL to sum last 12 month values from same table

    No need to LAG. Summary Functions are windowed too. It reads much cleaner.

    select PK_S, MonthDate,Leavers

    ,SUM(Leavers) OVER(ORDER BY PK_S DESC

    ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: get the price of last buy of each sell

    I think by "last" he means the last buy on the list before an S appears (reading top to bottom). That would actually be the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: get the price of last buy of each sell

    I see what you are after, but I have a question. Why is your buy for 108.58 associated with both sells at the top ( of 109.28...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Check if both fields from table B are in table A

    Like this? I had to change the data to make some combination work with what you are describing. Your sample gave NO combination which would work. Also,...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: tradeoffs in a sproc query design scenario?

    Why be that chatty? Paying network overhead twice?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Needing some help - Moving data from one table to multiple

    I'm reading that one large input table needs to be split and merged into three tables which are subsets of the imported table. That isn't complicated. And...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: CSV split in columns

    This should work, but I really don't like your input data set. You are showing the text for colors AND their codes, the sizes AND their codes. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: tradeoffs in a sproc query design scenario?

    If your application can handle getting two result sets, I'd go that way.

    You do have a column that can associate the perms with their users?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 346 through 360 (of 4,080 total)