Viewing 15 posts - 1 through 15 (of 24 total)
create table temp1empdtls(empno int,empname varchar(50),age int)
insert into temp1empdtls values(11,'John','38')
insert into temp1empdtls values(12,'Eric','20')
insert into temp1empdtls values(13,'Adam','40')
select * from temp1empdtls
--create temp emp dtls table whose details are loaded by SSIS package with...
February 8, 2012 at 3:46 am
Is doesn't work use 'except'
February 8, 2012 at 2:45 am
HI You can get the best answer in this topic:
December 13, 2011 at 6:59 am
HI Jeff.Thanks a lot
Jeff Moden (10/8/2011)
yubo1 (10/8/2011)
create table test
(
string varchar(max)
)
insert into test
select 'A#B#C'
select SUBSTRING(string+'#',number,charindex('#',string+'#',number)-number) from
test,
(select number from master..spt_values where number>=1 and type='P')t
where SUBSTRING('#'+string,number,1)='#'
Yubo1,
That method is the "old" method of splitting...
October 9, 2011 at 6:37 am
create table test
(
string varchar(max)
)
insert into test
select 'A#B#C'
select SUBSTRING(string+'#',number,charindex('#',string+'#',number)-number) from
test,
(select number from master..spt_values where number>=1 and type='P')t
where SUBSTRING('#'+string,number,1)='#'
October 8, 2011 at 2:09 am
HI where is the DDL,but you can try sql_code below anyway
select * from [table_name] a
where (select COUNT(1) from [table_name] b where a.Date_Signed=b.Date_Signed)>1
October 8, 2011 at 1:44 am
restart the sql server services for try
September 29, 2011 at 9:22 pm
The test sql_code below is you want?
create table table1
(
topicID int,
questionid int
)
create table table2
(
questionid int
)
insert into table1
select 1,1
union all
select 1,2
union all
select 1,2
union all
select 2,4
insert into table2
select 1
union all
select 2
union...
September 29, 2011 at 9:18 pm
HowardW (9/29/2011)
yubo1 (9/29/2011)
yubo1 (9/29/2011)
ROW_NUMBER() OVER ( ORDER BY ID ) RowNum
FROM #test where colC is not...
September 29, 2011 at 7:05 am
yubo1 (9/29/2011)
ROW_NUMBER() OVER ( ORDER BY ID ) RowNum
FROM #test where colC is not null
union
SELECT ...
September 29, 2011 at 4:50 am
SELECT Field1 FROM C
The Field1 is Table1's column
subquery can use outer table's column
September 29, 2011 at 4:40 am
SELECT * ,
ROW_NUMBER() OVER ( ORDER BY ID ) RowNum
FROM #test where colC is not null
union
SELECT *...
September 29, 2011 at 4:35 am
You can use 'union' to achieve ,like null union non-null
here are test sql_code below:
create table test
(
col1 int,
col2 int
)
insert into test
select 1,null
union
select 2,2
union
...
September 29, 2011 at 4:33 am
You can use 'set datefirst 7' to set sunday is the first date of a week in you sql-query
September 28, 2011 at 12:03 am
Viewing 15 posts - 1 through 15 (of 24 total)