Viewing 15 posts - 1,066 through 1,080 (of 4,080 total)
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
June 21, 2011 at 4:55 pm
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
June 21, 2011 at 4:43 pm
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
June 21, 2011 at 2:43 pm
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
June 21, 2011 at 2:01 pm
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
June 21, 2011 at 12:57 pm
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
June 21, 2011 at 8:26 am
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
June 20, 2011 at 1:39 pm
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
June 20, 2011 at 12:59 pm
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
June 20, 2011 at 9:31 am
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
June 20, 2011 at 8:17 am
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
June 19, 2011 at 8:53 pm
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
June 17, 2011 at 1:42 pm
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
June 17, 2011 at 8:49 am
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
June 17, 2011 at 8:28 am
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 differentc=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
June 17, 2011 at 8:01 am
Viewing 15 posts - 1,066 through 1,080 (of 4,080 total)