Viewing 15 posts - 241 through 255 (of 321 total)
create table #ids( n int,name varchar(20))
insert into #ids (n,name) values (7534,'tt')
insert into #ids (n,name) values (7535,'tt')
insert into #ids (n,name) values (7536,'tt')
insert into #ids (n,name) values (7537,'nn')
insert into #ids (n,name) values...
June 17, 2005 at 10:07 am
Sahana can you post your table + sample data (declare @t table....
insert so I just copy in queryAnalixzer : )
and the result that you want
June 17, 2005 at 9:42 am
I m using pair of consecutive rows from a self join
row1 will pair with row2
and I extract the rows where is a variance in group value
for example...
June 17, 2005 at 9:22 am
sahana smthing similar :
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=191316#bm191447
June 17, 2005 at 9:07 am
This case happen when the diagram was made on a SQL with SP4 and you try to open on a SQL SP3a
June 17, 2005 at 8:57 am
SELECT a.*
FROM TABLE1 a LEFT OUTER JOIN TABLE2 b
ON b.Client_Id =a.Client_ID
WHERE b.ClientID IS NULL
AND a.Country_Id=61
June 17, 2005 at 7:48 am
Improved plan:
SET NOCOUNT ON
Declare @tbl Table (
CustomerCode varchar(50),
AddressType varchar(50),
DateReceived datetime,
Line1 varchar(50),
Line2 varchar(50),
Line3 varchar(50),
Line4 varchar(50),
ZipCode varchar(50),
AddressId int identity(1,1))
INSERT INTO @tbl
SELECT
'CustomerCode', 'AddressType-5',...
June 17, 2005 at 7:41 am
either you choose DataType DECIMAL(12,2) for expl
either you use
CAST(MyNmb*100 AS INT)/100
June 16, 2005 at 1:59 pm
From what I read this query MIGHT be what you need
SELECT CounterID, CounterDateTime,MAX(C1) AS 'Total % Used',MAX(C2) AS 'P1 % Used',
MAX(C3) AS 'P2 % Used', MAX(C4) AS 'P3 % Used',...
June 16, 2005 at 1:51 pm
Improved plan
SELECT X.a,X.b,X.c,MAX(Y.D),X.d
FROM
(SELECT a.a,a.b,a.c,a.d
FROM @tbl a LEFT OUTER JOIN @tbl b
ON a.a=b.a AND a.b=b.b AND a.d=b.d-1
WHERE a.c!=b.c or b.a IS NULL
) X
INNER JOIN
(SELECT...
June 16, 2005 at 12:47 pm
Better do this at the client side:
SET NOCOUNT ON
Declare @tbl Table (a int, b int, c int ,d int)
insert into @tbl SELECT 1, 12 ,50 ,1
insert into @tbl SELECT 1 ...
June 16, 2005 at 10:12 am
The format of the displayed date is given by your computer settings
June 16, 2005 at 7:23 am
Convert will help you format your date (or datepart)
June 16, 2005 at 6:59 am
Viewing 15 posts - 241 through 255 (of 321 total)