Viewing 15 posts - 136 through 150 (of 568 total)
Hi,
Unless the table schema and few data, it’s hard to take the decision, however try this
update a
set a.j_num = c.new_j_num
from p_audit a,tbl1 b, tbl2 c
where
b.p_numr=a.new_p_num and
b.tbl1_id=c.tbl2_id
December 9, 2009 at 3:42 am
Hi,
In my desk no errors show yet. Check the data you have.
December 9, 2009 at 3:31 am
:w00t:
you are welcome!!!
December 9, 2009 at 3:14 am
Hi,
Yes this also corrected by means of call the sub statement in the rollup like
Use this data
select 'XX1',2,'AA',10
union all
select 'XX1',1,'BB',30
union all
select 'XX2',4,'CC',30
union all
select 'XX2',5,'DD',40
union all
select 'XX2',3,'EE',50
union all
select 'XX3',6,'FF',50
Your existing statement
select...
December 9, 2009 at 2:58 am
Hi,
Nice approach with rollup, rollup also another way to achieve this requirement, but what the OP say this different, that is, try to compare with arrive result and find. ...
December 9, 2009 at 2:00 am
Hi,
Is really need to show in this format?
Ok try this
declare @result numeric(16,5), @final nchar(16)
set @result = 100
set @final = REPLICATE('0',(10-len(floor(@result))))+ cast(@result as nchar(16))
select @final
December 8, 2009 at 11:46 pm
Hi, try this
create table #temp1
(
CCID varchar(10),
Sno int,
Item varchar(10),
Amount int
)
insert into #temp1
select 'XX1',1,'AA',10
union all
select 'XX1',2,'BB',30
union all
select 'XX2',3,'CC',30
union all
select 'XX2',4,'DD',40
union all
select 'XX2',5,'EE',50
union all
select 'XX3',6,'FF',50
select CCID,Sno,Item,Amount from #temp1
union all
select a.CCID,a.Sno+1,b.Item,a.Amount
from (select CCID,max(Sno)Sno,sum(Amount)Amount
from #temp1
group...
December 7, 2009 at 11:22 pm
Hi,
Cewii lift good question, OP may forget to mentioned this, unless the common character how we move further? Ok let assume and doing,
The common characters exists in the string, try...
December 7, 2009 at 11:00 pm
Ankur Bhardwaj (12/7/2009)
Find all the employees who have joined at last day of month in last 3 years (2007,2008,2009)
Hi,
First you get the last date for all month like
create table #temp
(
slno...
December 7, 2009 at 4:26 am
smthembu (12/6/2009)
but the temp table and the union statements are confussing.
Hi,
Ok, the mentioned above #temp1 table is for the example table, I don’t know the real source table from your...
December 6, 2009 at 11:58 pm
hi,
NO, this for the sample to understand with one record,
you try this way
create table #temp1
(
name1 varchar(50)
)
insert into #temp1
select 'A,AA'
union all
select 'AA,AAA'
union all
select 'AAA,AAAA'
union all
select 'B,BB'
union all
select 'BB,BBB'
union all
select 'BBB,BBBB'
select substring(name1,0,patindex('%,%',name1))first_col,
substring(name1,patindex('%,%',name1)+1,len(name1))...
December 6, 2009 at 11:26 pm
Hi, try this,
declare @result varchar(50)
set @result = 'smith,john'
select substring(@result,0,patindex('%,%',@result))first_col,
substring(@result,patindex('%,%',@result)+1,len(@result)) se_col
December 6, 2009 at 11:16 pm
jprabha.d (12/5/2009)
Hi ,the first column is of DateTime
The second column is of varchar datatypes.
thanx
Jaya
Hi,
create table #temp2
(DATE1 smalldatetime,memory varchar(5))
insert into #temp2
select '2009-01-01 01:00:00',11
union all
select '2009-01-01 02:00:00',22
union all
select '2009-01-01 08:00:00',33
union...
December 5, 2009 at 2:50 am
Hi, try this
create table #temp2
(DATE1 smalldatetime,memory float)
insert into #temp2
select '2009-01-01 01:00:00',11
union all
select '2009-01-01 02:00:00',22
union all
select '2009-01-01 08:00:00',33
union all
select '2009-01-01 10:00:00',44
union all
select '2009-01-01 15:00:00',55
union all
select '2009-01-02 06:00:00',66
union all
select '2009-01-02 12:00:00',77
union all
select...
December 5, 2009 at 1:08 am
December 4, 2009 at 10:22 pm
Viewing 15 posts - 136 through 150 (of 568 total)