Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 4,080 total)

  • RE: Finding maximum value out of 5 different columns

    Michael, if I may, you are being nit-picky at this point. 😛 Let's not assume the columns hold INT values. ...

    __________________________________________________

    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: Tricky Select statement

    Are you looking for something more like this?

    declare @sample table (column1 int, column2 int)

    declare @work table (col2 int primary key)

    insert into @sample

    select 123, 888 union all

    select 123, 999 union all

    select...

    __________________________________________________

    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 maximum value out of 5 different columns

    Good point about the null columns. I hadn't thought about that.

    I believe this fixes it though. Not too ugly and still gets the job...

    __________________________________________________

    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: Tricky Select statement

    declare @sample table (column1 int, column2 int)

    insert into @sample

    select 123, 888 union all

    select 123, 999 union all

    select 123, 888 union all

    select 456, 777

    select *

    from @sample

    where column1 in (select column1...

    __________________________________________________

    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 maximum value out of 5 different columns

    Scott, will you clarify what you think won't work on 2005? The last thing I posted works just fine on a 2005 instance.

    By the way, there are...

    __________________________________________________

    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 query

    declare @sample table (Item varchar(20), Code varchar(20))

    insert into @sample

    Select 'Item1' ,'CodeA' union all

    Select 'Item1' ,'CodeB' union all

    Select 'Item1' ,'CodeC' union all

    Select 'Item2' ,'CodeA' union all

    Select 'Item2' ,'CodeB' union all

    Select 'Item3'...

    __________________________________________________

    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: Nested Joins? or Selects?

    Use LEFT OUTER JOIN whenever you want to see rows in the primary table, whether or not matching rows exist in the joined table. INNER JOIN...

    __________________________________________________

    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: How to avoid convert function in the where clause???

    No rush, but thank you for replying.

    __________________________________________________

    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: How to Compare Month\date

    Let me echo OPC.THREE's request.

    What he is asking for are the statements to create sample tables and populate them with sample data. ...

    __________________________________________________

    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: How to avoid convert function in the where clause???

    Where did you include the index schema?

    __________________________________________________

    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: How to avoid convert function in the where clause???

    seek also is taking time because it has to retrive many rows

    You've just stated the heart of the problem.

    A seek can just mean that the query...

    __________________________________________________

    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: Are the posted questions getting worse?

    GilaMonster (6/17/2011)


    Anyone got a magic wand? http://www.sqlservercentral.com/Forums/FindPost1127588.aspx

    Solid State hard drives?

    __________________________________________________

    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: How to avoid convert function in the where clause???

    No argument, Gail. They don't have the index structure in place for a merge join.

    I'm just saying that even a hash match can only run so fast.

    __________________________________________________

    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: How to avoid convert function in the where clause???

    Just looked at the last execution plan. Even though your index seeks limit the number of rows from your two tables, you are still joining almost 400,000...

    __________________________________________________

    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: comparing the varchar data type value

    glen.wass (6/16/2011)


    can you elaborate a bit more please if i search for the ascii value of c and C the values are different

    c=99 and C=67

    Unless you have case sensitive collation...

    __________________________________________________

    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 - 1,066 through 1,080 (of 4,080 total)