Click here to Skip to main content
15,559,567 members
Home / Discussions / Database
   

Database

 
QuestionSQL Server Trigger Pin
irusul1-Jul-08 10:48
irusul1-Jul-08 10:48 
AnswerRe: SQL Server Trigger Pin
Giorgi Dalakishvili1-Jul-08 11:14
mentorGiorgi Dalakishvili1-Jul-08 11:14 
AnswerRe: SQL Server Trigger Pin
Mycroft Holmes1-Jul-08 15:06
professionalMycroft Holmes1-Jul-08 15:06 
AnswerRe: SQL Server Trigger Pin
TheFM2342-Jul-08 5:29
TheFM2342-Jul-08 5:29 
GeneralRe: SQL Server Trigger Pin
Mycroft Holmes2-Jul-08 22:22
professionalMycroft Holmes2-Jul-08 22:22 
QuestionStore Procedure Pin
brettokumar1-Jul-08 2:43
professionalbrettokumar1-Jul-08 2:43 
AnswerRe: Store Procedure Pin
SomeGuyThatIsMe1-Jul-08 3:57
SomeGuyThatIsMe1-Jul-08 3:57 
QuestionHelp In Query Pin
Saiyed Alam1-Jul-08 2:06
Saiyed Alam1-Jul-08 2:06 
Friends I have written a Stored Procedure like below. But It's not working. Can Any1 help me solving this plz


create procedure sp_victim_status_by_casenumber

SELECT District, Thana, CaseNumber, COUNT(IdVictim) AS Male, 0 AS Victim
into #tmp4
FROM tblVictim
WHERE Gender = 'Male'
GROUP BY District, Thana, CaseNumber

insert into #tmp4
SELECT District, Thana, CaseNumber, 0 AS Victim, COUNT(IdVictim) AS Male
FROM tblVictim
GROUP BY District, Thana, CaseNumber



SELECT District, Thana, CaseNumber, COUNT(IdVictim) AS Female
into #tmp4
FROM tblVictim
WHERE Gender = 'Female'
GROUP BY District, Thana, CaseNumber


insert into #tmp4
SELECT District, Thana, CaseNumber,0 AS Victim, COUNT(IdVictim) AS Female
FROM tblVictim
GROUP BY District, Thana, CaseNumber



select District, Thana, CaseNumber,sum (Victim) as Victim, sum( Male) as Male, sum(Female) as Female
from #tmp4
group by District, Thana, CaseNumber



Any help would be really helpful.
AnswerRe: Help In Query Pin
SomeGuyThatIsMe1-Jul-08 4:09
SomeGuyThatIsMe1-Jul-08 4:09 
GeneralRe: Help In Query Pin
Saiyed Alam1-Jul-08 6:27
Saiyed Alam1-Jul-08 6:27 
QuestionConnection: login failed - State 16 Pin
DharperII1-Jul-08 1:52
DharperII1-Jul-08 1:52 
QuestionSql server replication (from 2000 to 2005) Pin
acodman1-Jul-08 0:49
acodman1-Jul-08 0:49 
QuestionReporting Services - Controlling number of rows of a table control Pin
Rashmi Deshpande1-Jul-08 0:47
Rashmi Deshpande1-Jul-08 0:47 
Questionsql query Pin
Pankaj Garg30-Jun-08 22:25
Pankaj Garg30-Jun-08 22:25 
AnswerRe: sql query Pin
Giorgi Dalakishvili30-Jun-08 22:27
mentorGiorgi Dalakishvili30-Jun-08 22:27 
GeneralRe: sql query Pin
Pankaj Garg30-Jun-08 22:31
Pankaj Garg30-Jun-08 22:31 
GeneralRe: sql query Pin
Giorgi Dalakishvili1-Jul-08 5:20
mentorGiorgi Dalakishvili1-Jul-08 5:20 
AnswerRe: sql query Pin
TheFM2342-Jul-08 4:43
TheFM2342-Jul-08 4:43 
QuestionHow to get the second occuring of a row Pin
Exelioindia30-Jun-08 5:09
Exelioindia30-Jun-08 5:09 
AnswerRe: How to get the second occuring of a row Pin
SomeGuyThatIsMe30-Jun-08 9:39
SomeGuyThatIsMe30-Jun-08 9:39 
Questionconnecting to remote sql server Pin
kadkir30-Jun-08 4:48
kadkir30-Jun-08 4:48 
AnswerRe: connecting to remote sql server Pin
rrrriiizz2-Jul-08 20:37
rrrriiizz2-Jul-08 20:37 
QuestionSQL Server 2008 Express Pin
Brendan Vogt30-Jun-08 4:26
Brendan Vogt30-Jun-08 4:26 
AnswerRe: SQL Server 2008 Express Pin
Mark Salsbery30-Jun-08 8:01
Mark Salsbery30-Jun-08 8:01 
AnswerRe: SQL Server 2008 Express Pin
Paul Conrad30-Jun-08 8:05
professionalPaul Conrad30-Jun-08 8:05 

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.