Click here to Skip to main content
15,562,223 members
Home / Discussions / Database
   

Database

 
GeneralRe: help me to write procedure Pin
Paul Conrad13-Jul-08 19:06
professionalPaul Conrad13-Jul-08 19:06 
GeneralRe: help me to write procedure Pin
amistry_petlad13-Jul-08 19:12
amistry_petlad13-Jul-08 19:12 
GeneralRe: help me to write procedure Pin
Paul Conrad13-Jul-08 19:16
professionalPaul Conrad13-Jul-08 19:16 
GeneralRe: help me to write procedure Pin
nelsonpaixao13-Jul-08 16:12
nelsonpaixao13-Jul-08 16:12 
GeneralRe: help me to write procedure Pin
amistry_petlad13-Jul-08 18:58
amistry_petlad13-Jul-08 18:58 
Questiondecimal not show zero [modified] Pin
tai-fun12-Jul-08 4:38
tai-fun12-Jul-08 4:38 
AnswerRe: decimal not show zero Pin
leoinfo12-Jul-08 8:07
leoinfo12-Jul-08 8:07 
Questionrow to column in sql Pin
ravindra_ee24811-Jul-08 20:58
ravindra_ee24811-Jul-08 20:58 
SELECT clientid,sum( isnull([CDMAWeB],0)) as cdmaweb,sum(isnull( [GSMWEB],0)) gsmweb,sum(isnull([CDMAURL],0))cdmaurl,sum( isnull([GSMURL],0))gsmurl,sum(isnull([CDMAXML],0))cdmaxml,sum( isnull([GSMWXML],0))gsmxml FROM
( SELECT TBL_REQUEST_DETAILS.ClientID, SUM(TBL_TPM_CAMPAIGN_DETAILS.CountOfSMSSent) AS count,
CASE
WHEN LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4)
= '9193'and TBL_REQUEST_DETAILS.RequestReceivedVia ='WEB'
THEN 'CDMAWEB'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) = '9192'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='WEB'
THEN 'CDMAWEB'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) = '9193'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='URL'
THEN 'CDMAURL'
WHEN LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) = '9192'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='URL'
THEN 'CDMAURL'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4)
= '9193'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='XML'
THEN 'CDMAXML'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) = '9192'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='XML'

THEN 'CDMAXML'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9192'
and LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9193'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='WEB'
THEN 'GSMWEB'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9192'
and LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9193'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='URL'
THEN 'GSMURL'
WHEN
LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9192'
and LEFT(TBL_TPM_CAMPAIGN_DETAILS.mobilenumber, 4) != '9193'
and TBL_REQUEST_DETAILS.RequestReceivedVia ='XML'
THEN 'GSMXML'
END AS 'bearer',
TBL_REQUEST_DETAILS.RequestReceivedVia

FROM TBL_TPM_CAMPAIGN_DETAILS INNER JOIN
TBL_TPM_SMSC ON TBL_TPM_CAMPAIGN_DETAILS.SMSCID = TBL_TPM_SMSC.SMSCID LEFT OUTER JOIN
TBL_REQUEST_DETAILS ON TBL_TPM_CAMPAIGN_DETAILS.RequestDetailsID = TBL_REQUEST_DETAILS.RequestID
GROUP BY TBL_TPM_CAMPAIGN_DETAILS.MobileNumber, TBL_REQUEST_DETAILS.ClientID,
TBL_REQUEST_DETAILS.RequestReceivedVia
)AS S PIVOT ( SUM (count) FOR bearer IN ( [CDMAWeB], [GSMWEB],[CDMAURL], [GSMURL],[CDMAXML], [GSMWXML]) ) AS pvt
group by clientid

Sunny

AnswerRe: row to column in sql Pin
Vimalsoft(Pty) Ltd13-Jul-08 16:55
professionalVimalsoft(Pty) Ltd13-Jul-08 16:55 
QuestionMail Triggering in SQL_Server Problem Pin
sabaMCA11-Jul-08 14:43
sabaMCA11-Jul-08 14:43 
AnswerRe: Mail Triggering in SQL_Server Problem Pin
Vimalsoft(Pty) Ltd12-Jul-08 12:11
professionalVimalsoft(Pty) Ltd12-Jul-08 12:11 
QuestionMail Triggering in SQL_Server Problem Pin
sabaMCA11-Jul-08 14:42
sabaMCA11-Jul-08 14:42 
QuestionHow to store stored proc results to a temp table Pin
DotNetXenon11-Jul-08 11:52
DotNetXenon11-Jul-08 11:52 
AnswerRe: How to store stored proc results to a temp table Pin
Vimalsoft(Pty) Ltd12-Jul-08 12:17
professionalVimalsoft(Pty) Ltd12-Jul-08 12:17 
GeneralSQL Server connection timeout [modified] Pin
dlarkin7711-Jul-08 4:44
dlarkin7711-Jul-08 4:44 
GeneralRe: SQL Server connection timeout Pin
Simon P Stevens11-Jul-08 4:48
Simon P Stevens11-Jul-08 4:48 
GeneralRe: SQL Server connection timeout Pin
SimulationofSai11-Jul-08 5:07
SimulationofSai11-Jul-08 5:07 
GeneralRe: SQL Server connection timeout Pin
dlarkin7711-Jul-08 5:26
dlarkin7711-Jul-08 5:26 
GeneralRe: SQL Server connection timeout Pin
Member 9611-Jul-08 6:46
Member 9611-Jul-08 6:46 
GeneralRe: SQL Server connection timeout Pin
Tomz_KV11-Jul-08 6:48
Tomz_KV11-Jul-08 6:48 
QuestionSystem IP in Stored Procedure Pin
Member 400849210-Jul-08 19:51
Member 400849210-Jul-08 19:51 
AnswerRe: System IP in Stored Procedure Pin
N a v a n e e t h10-Jul-08 23:46
N a v a n e e t h10-Jul-08 23:46 
AnswerRe: System IP in Stored Procedure Pin
DerekFL11-Jul-08 5:50
DerekFL11-Jul-08 5:50 
QuestionInserting data into xml column Pin
DerekFL10-Jul-08 10:45
DerekFL10-Jul-08 10:45 
AnswerRe: Inserting data into xml column Pin
leoinfo10-Jul-08 17:31
leoinfo10-Jul-08 17:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.