Viewing 15 posts - 1 through 15 (of 20 total)
Yes, had to take the approach of breaking it down into further variables, then concatting the results together.
Seems like it would be a nice thing to have the ability to...
January 25, 2011 at 3:25 am
Performed a quick perf. analysis, as suspected.. here are the results:
Query 1: [K's]
select distinct ID, Name = CONVERT(varchar(50),'')
into #t1
from T1
update #t1
set #t1.Name = T1.Name
from T1 inner join #t1
on #t1.ID =T1.ID
select...
July 21, 2008 at 7:05 am
Well I posted a SQL 2005 solution to the question (which the poster seems to fit fine, as this is really a sql 2005 solution not sql7/2000 - yes posted...
July 21, 2008 at 1:53 am
Even if there is a lot of cost involved in estimating that variable, I will guarantee the non-cursor solution will run significantly faster.
If the @est var is hard to calculate,...
July 18, 2008 at 9:27 am
Why use a cursor??
If you have a quick look in BOL, you can perform this without any cursor.. [UPDATE (T-SQL)]. There is an ability to link the current record...
July 18, 2008 at 9:15 am
I noticed that we didnt really analyse all solutions that are best for performance
(Just looked at the solutions that were all the same)
- I'll recall from the thread: [From the...
July 18, 2008 at 9:04 am
This is the SQL Server 2005 version:
select distinct id,value, rank() over (partition by id order by value)
from
(select '1' id,'br' value
union
select '1','er'
union
select '2','rt'
union
select '2','uj'
union
select '3','iu'
union
select '3','ol') data
Output:
idvalue(No column name)
1br1
1er2
2rt1
2uj2
3iu1
3ol2
As...
July 16, 2008 at 10:25 am
Okay so the posters had part I published several times, with various answers... using min/max, a subquery, a temp-table.
The perfm. analysis can be made easily by Sam/others just run them...
July 16, 2008 at 9:19 am
You can actually get rid of the distinct part of the example query, as this is implicit by using the group by and serves no purpose:
select id, max(value) ...
July 15, 2008 at 9:21 am
Try something like this:
select distinct id, min(value) value
from
(select '1' id,'br' value
union
select '1','er'
union
select '2','rt'
union
select '2','uj'
union
select '3','iu'
union
select '3','ol') data
group by id
-- Output:
idvalue
1br
2rt
3iu
July 15, 2008 at 5:59 am
Yes this is possible vis sp_binddefault (not via design mode , TSQL only).
But - word of warning, this will be removed in a future release of sql-server.
If you wanted to...
July 4, 2008 at 4:15 am
Loner,
Certification is not about how good a DBA or developer someone is- unfortunatly. Neither is years of experience (as I have found - never judge a book by how...
July 3, 2008 at 10:05 am
thank-you chris, gone back and editied my incorrect values/spec
July 2, 2008 at 5:00 am
Hi Saritha,
Think you may have made the first initial mistake that I did, (whilst was determining what the poster required - as was not the clearest)..
Background
Table: Has dup rows
Requirement: [Edited...
July 2, 2008 at 3:48 am
Yes the solution I posted, like others would work on SQL 2005, and not SQL 2000.
Sometimes, we'll look at things not in the exact way a poster wants, but...
July 2, 2008 at 2:22 am
Viewing 15 posts - 1 through 15 (of 20 total)