Viewing 15 posts - 511 through 525 (of 1,114 total)
Trevor,
Try the below code and let me know.
Select TOP 3 NumberValue,NumberTimesUsed
from Number
order by NumberOfTimesUsed desc
August 12, 2008 at 6:28 am
Why i changed ?
Becuase if the table get one more row say for example
insert into Client_Table
select 9001,4,'Gail','Active'
Initial method won't do our need. So i have changed the code.
August 12, 2008 at 6:15 am
A little modification in the code.
Just change the second update statement.
Update #t1
set Name2 = isnull(( select Name
...
August 12, 2008 at 6:09 am
Sudheer,
Try it out.
Create table Client_Table
(
ID int,
SUB int,
Name varchar(30),
Status varchar(10)
)
go
insert into Client_Table
Select 9001,1,'Mark','Active'
union all
select 9001,2,'Will','InActive'
union all
select 9001,3,'steve','Active'
union all
select 9002,1,'chals','Active'
union all
select 9003,1,'ken','Active'
union all
select 9003,2,'dave','Active'
union all
select 9004,1,'peter','Active'
union all
select 9004,2,'Jack','InActive'
select ID,Name,Seq = IDENTITY(int,1,1),'Name1' =...
August 12, 2008 at 5:40 am
August 11, 2008 at 6:12 am
trevorjv,
Before that i would suggest you to read about 'Tally' table. Becuase i have used that table in my code.
August 11, 2008 at 6:08 am
Do you hope to find anything what requires less maintenance than an index?
Obviously, index requires less maintenace.
Simply, i wanted to know other approaches. Because each people will think differently. Thats...
August 11, 2008 at 6:06 am
Hey Sergiy,
I do agree with you.:)
INDEX Will help us to achieve our requirement. Honestly, I am not offending you. Thanks for your idea.
But Simply, i wanted to know some...
August 11, 2008 at 5:50 am
If we convert it into a SP, then we can change the input values as required.
Create Procedure PrintReverse
(
@NumberToReverse int,
@NoOfTimesRepeat int
)
Select REPLICATE(@NumberToReverse,N)
from Tally,NUM
where N <= @NoOfTimesRepeat
and NumberValue = @NumberToReverse
UNION ALL
select...
August 11, 2008 at 5:47 am
Christopher,
why can't we use Tally or Number table ?
My approach :
Select REPLICATE('1',N),N
from Tally,NUM
where N <= 6
and NumberValue = 1
union all
select REP,N from (Select REPLICATE('1',N) as REP ,N
from Tally,NUM
where N...
August 11, 2008 at 5:36 am
why ?
Just i wanted to know different ideas for a single problem !
Because i suggested another way also.
"Instead of runNing min() and max() function, we can kept that information in...
August 11, 2008 at 5:05 am
Hi Sergiy,
Thanks for your idea ! It is working !
But i am expecting some more ideas !
August 11, 2008 at 4:36 am
Steve,
Thanks for your feedback. I also suggested them to use 'DTS'.
If you came to know any tools apart from this one,Please let me know.
August 11, 2008 at 1:38 am
Viewing 15 posts - 511 through 525 (of 1,114 total)