Click here to Skip to main content
       

Database

 
GeneralRe: SQL Update Pinmemberjschell31-Jan-13 8:01 
AnswerRe: SQL Update PinmemberPIEBALDconsult29-Jan-13 13:22 
AnswerRe: SQL Update PinmemberJörgen Andersson30-Jan-13 1:21 
AnswerRe: SQL Update Pinmembermrfalk30-Jan-13 6:20 
QuestionDatabase backup size Pinmembersavbace28-Jan-13 22:45 
AnswerRe: Database backup size PinmemberRichard Deeming29-Jan-13 1:21 
QuestionSQL Server 2005 Express running slow ? PinmemberMember 245846728-Jan-13 15:56 
AnswerRe: SQL Server 2005 Express running slow ? PinmemberPIEBALDconsult28-Jan-13 16:11 
AnswerRe: SQL Server 2005 Express running slow ? PinmemberMycroft Holmes28-Jan-13 17:02 
AnswerRe: SQL Server 2005 Express running slow ? PinmemberJOAT-MON29-Jan-13 11:09 
QuestionCombining Data From Temp Tables PinmemberMatt U.28-Jan-13 8:46 
AnswerRe: Combining Data From Temp Tables PinmemberDavid Mujica28-Jan-13 9:13 
GeneralRe: Combining Data From Temp Tables PinmemberMatt U.28-Jan-13 9:54 
GeneralRe: Combining Data From Temp Tables PinmemberJörgen Andersson28-Jan-13 11:18 
I would use a pivot
SELECT UserId,ProductNum,Passed,Finished,Scrapped
FROM
(SELECT UserId, ProductNum, Qty, 'passed' as status
FROM    Passed
UNION
SELECT UserId, ProductNum, Qty, 'finished' as status
FROM   finished
UNION
SELECT UserId, ProductNum, Qty, 'scrapped' as status
FROM   scrapped
) AS SourceTable
PIVOT
(
sum(qty)
FOR status IN ('passed', 'finished','scrapped')
) AS PivotTable;
I havent tested this, but the principle should work.
I also have the opinion that you should normalize the database, several tables with the same content isn't good.
Put them together into one table with a status column.
People say nothing is impossible, but I do nothing every day.

GeneralRe: Combining Data From Temp Tables PinmemberMatt U.28-Jan-13 12:13 
GeneralRe: Combining Data From Temp Tables PinmemberMycroft Holmes28-Jan-13 12:00 
GeneralRe: Combining Data From Temp Tables PinmemberMatt U.28-Jan-13 12:16 
AnswerRe: Combining Data From Temp Tables PinmemberJörgen Andersson28-Jan-13 22:57 
GeneralRe: Combining Data From Temp Tables PinmemberMatt U.29-Jan-13 2:52 
GeneralRe: Combining Data From Temp Tables PinmemberJörgen Andersson29-Jan-13 3:02 
GeneralRe: Combining Data From Temp Tables PinmemberJörgen Andersson28-Jan-13 22:28 
Question[VB.net+ADO.net]how can combobox 1 control the result of combobox2 PinmemberAchilles8428-Jan-13 8:20 
AnswerRe: [VB.net+ADO.net]how can combobox 1 control the result of combobox2 PinmemberAchilles8430-Jan-13 3:47 
QuestionSMO Retrieve Table Record Pinmembersavbace28-Jan-13 2:31 
AnswerRe: SMO Retrieve Table Record PinmvpSandeep Mewara28-Jan-13 2:42 
AnswerRe: SMO Retrieve Table Record Pinmembersavbace28-Jan-13 2:55 
QuestionRe: SMO Retrieve Table Record PinmvpEddy Vluggen28-Jan-13 3:21 
AnswerRe: SMO Retrieve Table Record PinmvpSandeep Mewara28-Jan-13 3:22 
AnswerRe: SMO Retrieve Table Record Pinmembersavbace28-Jan-13 3:40 
Questionhow can reporting in this Situation [modified] Pinmemberkarimkpg26-Jan-13 2:38 
AnswerRe: how can reporting in this Situation PinmvpSandeep Mewara26-Jan-13 6:02 
QuestionQuery to concatenate multiple rows based on sequence in results set PinmemberAlex Lush24-Jan-13 22:43 
AnswerRe: Query to concatenate multiple rows based on sequence in results set PinmvpEddy Vluggen25-Jan-13 1:51 
AnswerRe: Query to concatenate multiple rows based on sequence in results set PinmemberShameel25-Jan-13 3:20 
GeneralRe: Query to concatenate multiple rows based on sequence in results set PinmemberAlex Lush25-Jan-13 3:30 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pinmembermmccarth25-Jan-13 5:21 
QuestionSyntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 14:40 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberMycroft Holmes23-Jan-13 15:02 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 15:25 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 15:37 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 16:16 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 16:26 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 16:58 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 16:59 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmvpRichard MacCutchan23-Jan-13 23:22 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult24-Jan-13 5:48 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro24-Jan-13 5:54 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult24-Jan-13 6:00 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro24-Jan-13 7:11 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult24-Jan-13 7:56 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 15 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid