Click here to Skip to main content
15,886,578 members
Home / Discussions / Database
   

Database

 
AnswerRe: calling stored procedure in case statement - Sql Server 2000 Pin
Pranay Rana3-Mar-10 19:04
professionalPranay Rana3-Mar-10 19:04 
GeneralRe: calling stored procedure in case statement - Sql Server 2000 Pin
Mycroft Holmes3-Mar-10 21:29
professionalMycroft Holmes3-Mar-10 21:29 
AnswerRe: calling stored procedure in case statement - Sql Server 2000 Pin
The Man from U.N.C.L.E.3-Mar-10 22:48
The Man from U.N.C.L.E.3-Mar-10 22:48 
QuestionWhats wrong with SQL statement? Pin
gengel2-Mar-10 19:47
gengel2-Mar-10 19:47 
AnswerRe: Whats wrong with SQL statement? [modified] Pin
Jörgen Andersson2-Mar-10 21:48
professionalJörgen Andersson2-Mar-10 21:48 
AnswerRe: Whats wrong with SQL statement? Pin
i.j.russell2-Mar-10 22:04
i.j.russell2-Mar-10 22:04 
GeneralRe: Whats wrong with SQL statement? Pin
gengel2-Mar-10 22:46
gengel2-Mar-10 22:46 
GeneralRe: Whats wrong with SQL statement? [modified] Pin
i.j.russell2-Mar-10 23:35
i.j.russell2-Mar-10 23:35 
Try this one.

SELECT u.ProductionNo,
   u.SHIPPED,
   l.PACKED
FROM 
(
   SELECT ProductionNo, 
      COUNT(SerialNo) AS SHIPPED
   FROM UNITS 
   WHERE ScanStatus = 'SHIPPED'
   GROUP BY ProductionNo
) u
LEFT OUTER JOIN 
(
   SELECT ProductionNo, 
      COUNT(SerialNo) AS PACKED
   FROM UNIT_Logs 
   WHERE Old_Status = 'PACKED'
   GROUP BY ProductionNo  
) l
ON l.ProductionNo = u.ProductionNo

[Fixed typo]
modified on Wednesday, March 3, 2010 7:56 AM

GeneralRe: Whats wrong with SQL statement? Pin
gengel3-Mar-10 1:14
gengel3-Mar-10 1:14 
GeneralRe: Whats wrong with SQL statement? Pin
gengel3-Mar-10 1:17
gengel3-Mar-10 1:17 
GeneralRe: Whats wrong with SQL statement? Pin
i.j.russell3-Mar-10 2:00
i.j.russell3-Mar-10 2:00 
QuestionPermission sp_rename Pin
Clas Andersson2-Mar-10 7:23
Clas Andersson2-Mar-10 7:23 
AnswerRe: Permission sp_rename Pin
Mycroft Holmes2-Mar-10 10:52
professionalMycroft Holmes2-Mar-10 10:52 
QuestionSql issue.. Pin
<<Tash18>>1-Mar-10 21:05
<<Tash18>>1-Mar-10 21:05 
AnswerRe: Sql issue.. Pin
J4amieC1-Mar-10 21:15
J4amieC1-Mar-10 21:15 
GeneralRe: Sql issue.. Pin
<<Tash18>>1-Mar-10 22:44
<<Tash18>>1-Mar-10 22:44 
GeneralRe: Sql issue.. Pin
J4amieC1-Mar-10 23:05
J4amieC1-Mar-10 23:05 
QuestionShould I index this? Pin
Mike6543211-Mar-10 9:22
Mike6543211-Mar-10 9:22 
AnswerRe: Should I index this? Pin
Luc Pattyn1-Mar-10 9:34
sitebuilderLuc Pattyn1-Mar-10 9:34 
GeneralRe: Should I index this? Pin
Mike6543211-Mar-10 9:42
Mike6543211-Mar-10 9:42 
GeneralRe: Should I index this? Pin
David Mujica1-Mar-10 10:20
David Mujica1-Mar-10 10:20 
GeneralRe: Should I index this? Pin
Mike6543211-Mar-10 20:30
Mike6543211-Mar-10 20:30 
QuestionLooking for a book on SSIS Pin
Corporal Agarn1-Mar-10 6:30
professionalCorporal Agarn1-Mar-10 6:30 
QuestionConcatenating strings in MS SQL Pin
#Jet1-Mar-10 1:05
#Jet1-Mar-10 1:05 
AnswerRe: Concatenating strings in MS SQL Pin
Corporal Agarn1-Mar-10 6:42
professionalCorporal Agarn1-Mar-10 6:42 

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.