Viewing 15 posts - 316 through 330 (of 434 total)
In the debug window is the auto rollback checkbox checked? I haven't tried this but I think that it if it is checked it automatically rolls back any transactions created...
June 21, 2007 at 11:53 am
If it has a key (and I called mine uid2 here) this may help. Not sure how fast it would run on a lot of rows.
select * from testperc t
left...
June 15, 2007 at 1:15 pm
does the table have a key?
June 15, 2007 at 12:46 pm
I agree that there is a lack of information but Aaron's query will return the values from a record although if column 1 is not unique it may still return...
June 13, 2007 at 4:34 pm
David's version will create a set of values from different records instead of all of the value's from one record. Don't know if it makes a diffrence to you but...
June 13, 2007 at 2:27 pm
Jeff did as close to that as possible unless you post your create table statements so we can have the tablenames, column names, datatypes and indexes.
Take Jeff's example and sub...
June 13, 2007 at 8:55 am
And here we see why I deferred to Jeff before sending another beginner down the slippery cursor slope.
June 13, 2007 at 7:26 am
ANd before I go suggesting a cursor and temp table to cycle through the different order channels I seem to remember Jeff Moden writing some cool code for doing medians...
June 12, 2007 at 5:41 pm
actually my queries are a little sloppy. The median doesn't take into account an even number of rows and the mode doesn't allow for tying values. Do you have a table...
June 12, 2007 at 3:34 pm
to get a median:
select top 1 [value_a]
from (select top 50 percent [value_a] from [junkit] order by [value_a] asc) a
order by [value_a] desc
to get mode
select top 1 [value_a] from (select top...
June 12, 2007 at 3:12 pm
Here is a variation that works with other datatypes
begin
declare @inst varchar(8000),@cnt varchar(5),@idx varchar(5)
select @inst = '''EN'',''DE'''
select @cnt = 0
select @idx = 1
while @idx > 0
begin
select @cnt=@cnt+1
select @idx = charindex(',',@inst,@idx+1)
end
exec ('select...
June 10, 2007 at 7:10 am
How about this:
begin
declare @inst varchar(8000),@sumst varchar(8000)
select @inst = '1,2,4'
select @sumst = replace(@inst,',','+')
exec ('select roomtype from mytable
where amenity in ('+@inst+')
group by roomtype
having sum(amenity) = ' + @sumst)
end
You can...
June 8, 2007 at 3:04 pm
Viewing 15 posts - 316 through 330 (of 434 total)