Viewing 15 posts - 1 through 15 (of 130 total)
ok
i tried this one
CREATE TABLE [dbo].[emp_new](
[empid] [int] NULL,
[primary1] [varchar](20) NULL,
[primaryinten1] [int] NULL,
[secondary2] [varchar](20) NULL,
[secondaryinten2] [int] NULL,
[secondary3] [varchar](20) NULL,
[secondaryinten3] [int] NULL,
[secondary4] [varchar](20) NULL,
[secondaryinten4] [int] NULL)
empidprimary1primaryinten1secondary2secondaryinten2secondary3secondaryinten3secondary4secondaryinten4
1HF1NULLNULLNULLNULLNULLNULLNULLNULL
1NULLNULLCAD1NULLNULLNULLNULLNULLNULL
1NULLNULLCADO1NULLNULLNULLNULLNULLNULL
1NULLNULLMAN1NULLNULLNULLNULLNULLNULL
1NULLNULLMANt1NULLNULLNULLNULLNULLNULL
now i tried
--select * from emp_new
----drop...
August 28, 2013 at 12:56 pm
i am not finding a solution,please help me hwo to do it
August 28, 2013 at 12:07 pm
the thing is i cannot use aggregate function in PIVOT , as i need to place character in the column
August 28, 2013 at 7:52 am
here @min-2 + @interval should not be > @end
how will i make sure that
August 16, 2013 at 7:47 am
no there is no more rule, but if you execute is second time it moves everything to scondition
and also there may be duplicate values
August 2, 2013 at 2:57 pm
IF YOU EXECUTING IT SECOND TIME it moves all the values to scondition
also if there is duplicate example
id pcondition scondition
1 sa ...
August 2, 2013 at 2:35 pm
this code is not working
it snot necessary that all 5 condition will exists for that particular ID, there can be 3 or 4 ,not all 5
in that case it has...
August 2, 2013 at 2:05 pm
u r updating cte i need to update customecode table
August 2, 2013 at 1:57 pm
but i dont need select ,i just need update statement, the store proc should not have select
August 2, 2013 at 1:16 pm
HERE YOU GO
CREATE TABLE CustomCode
(ID int,
pcondition varchar(50),
Pinten int,
scondition varchar(50),
sinten int)
INSERT into CustomCode
SELECT 1,'HF',1,NULL,NULL
UNION
SELECT 1,'CA',1,NULL,NULL
UNION
SELECT 1,'AF',1,NULL,NULL
UNION
SELECT 2,'CAD',2,null,NULL
UNION
SELECT 2,'AST',2,null,null
UNION
SELECT 3,'CA',1,NULL,NULL
UNION
SELECT 4,NULL,NULL,'HF',1
Order to Update :
If ID has more than...
August 2, 2013 at 12:35 pm
i am trying to explain it here
example:
ID pcondition scondition
1 HF ...
August 2, 2013 at 11:28 am
i used row_number ,but how to get multiple condition in update
for example if condition = 'HF'
then update
else if condition ='AST'
then update
August 2, 2013 at 11:04 am
but i need loop or condtion hwo to do it
example if primarycondition = 'HF'
then update table a
set secondary condtion = null
if there is no primary condition = 'HF'
then
if primarycondition =...
August 1, 2013 at 3:20 pm
thisis not the result that i want
i have five PRIMARY condition ,
hf,
COPD,
CAD,
dia,
ast
primary intensity could be 1,2, 3
now i want to check suppose if i have all 5 condition...
August 1, 2013 at 2:55 pm
my desire out put will be
Member primarycondition primaryintensity secondarycondition secondaryIntensity
M2345 hf ...
August 1, 2013 at 2:34 pm
Viewing 15 posts - 1 through 15 (of 130 total)