Viewing 11 posts - 76 through 87 (of 87 total)
February 25, 2010 at 11:46 am
;with t as(
select
H
, D
, (row_number() over (partition by H order by D) -1)/3 [grouping]
, (row_number() over (partition by H order by D) % 3) [clmn]
from
#A
)
select
H, [1], [2], [0]
from...
I Have Nine Lives You Have One Only
THINK!
February 25, 2010 at 5:14 am
what trouble?
;with cte as (
select
...
I Have Nine Lives You Have One Only
THINK!
February 25, 2010 at 5:01 am
select
H
, max(case when D %3 = 1 then D else 0 end) D1
, max(case when D %3 = 2 then D else 0 end) D2
, max(case when D %3 =...
I Have Nine Lives You Have One Only
THINK!
February 24, 2010 at 10:29 pm
maybe, it's help you
;with cte as (
select
coalesce(Postal_Address_Line_7, Postal_Address_Line_6, Postal_Address_Line_5, Postal_Address_Line_4,Postal_Address_Line_3, Postal_Address_Line_2, Postal_Address_Line_1) as Postal_Address_Line
, Postal_Address_Postcode
from #address_data
...
I Have Nine Lives You Have One Only
THINK!
February 24, 2010 at 11:50 am
it's my solution
first step - we try to update record
secod step - if no record have been updated then we insert record
update Table
set field1 = @field
where field2 = @key
if @@rowcount=0
begin
...
I Have Nine Lives You Have One Only
THINK!
February 21, 2010 at 2:54 pm
SELECT TOP (1) WITH TIES add to code of Paul White
Because can be more than one record
I Have Nine Lives You Have One Only
THINK!
February 20, 2010 at 12:55 pm
My reply will help you too
Dave Ballantyne
It's a good article
but we need one more table "Calendar"
and i don't know if it is possible for Sridhar-137443
I Have Nine Lives You Have One Only
THINK!
February 19, 2010 at 8:56 am
CREATE TABLE dbo.mytable
( low int, high int, myavg AS (low / high)*100 ) ;
?
I Have Nine Lives You Have One Only
THINK!
February 19, 2010 at 2:53 am
The continuous period when the end of one coincides with the beginning of another
first period
'20060905','20070827'
'20070828', '20080304'
'20080305', '20080420'
'20080421', '20080423'
second
'20080425', '20080429'
'20080430', '20080430'
third
'20080424', '20090920'
fourth
'20100101', '20991231'
I Have Nine Lives You Have One Only
THINK!
February 19, 2010 at 1:39 am
create table #Example(
Company varchar(10),
Empno int,
Id int,
CourseId int,
Startdate datetime,
Stopdate datetime
)
insert into #Example(Company, Empno, Id, CourseId, Startdate, Stopdate)
select 'TTT', 1, 01, 11, '20060905','20070827'
union all
select 'TTT', 1, 01, 11, '20070828', '20080304'
union all
select 'TTT',...
I Have Nine Lives You Have One Only
THINK!
February 19, 2010 at 12:34 am
Viewing 11 posts - 76 through 87 (of 87 total)