Click here to Skip to main content
11,642,613 members (62,981 online)
   

Database

 
QuestionSQL Server 2005 Express running slow ? Pin
Member 245846728-Jan-13 15:56
memberMember 245846728-Jan-13 15:56 
AnswerRe: SQL Server 2005 Express running slow ? Pin
PIEBALDconsult28-Jan-13 16:11
memberPIEBALDconsult28-Jan-13 16:11 
AnswerRe: SQL Server 2005 Express running slow ? Pin
Mycroft Holmes28-Jan-13 17:02
memberMycroft Holmes28-Jan-13 17:02 
AnswerRe: SQL Server 2005 Express running slow ? Pin
JOAT-MON29-Jan-13 11:09
memberJOAT-MON29-Jan-13 11:09 
QuestionCombining Data From Temp Tables Pin
Matt U.28-Jan-13 8:46
memberMatt U.28-Jan-13 8:46 
AnswerRe: Combining Data From Temp Tables Pin
David Mujica28-Jan-13 9:13
memberDavid Mujica28-Jan-13 9:13 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.28-Jan-13 9:54
memberMatt U.28-Jan-13 9:54 
GeneralRe: Combining Data From Temp Tables Pin
Jörgen Andersson28-Jan-13 11:18
memberJö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 Pin
Matt U.28-Jan-13 12:13
memberMatt U.28-Jan-13 12:13 
GeneralRe: Combining Data From Temp Tables Pin
Mycroft Holmes28-Jan-13 12:00
memberMycroft Holmes28-Jan-13 12:00 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.28-Jan-13 12:16
memberMatt U.28-Jan-13 12:16 
AnswerRe: Combining Data From Temp Tables Pin
Jörgen Andersson28-Jan-13 22:57
memberJörgen Andersson28-Jan-13 22:57 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.29-Jan-13 2:52
memberMatt U.29-Jan-13 2:52 
GeneralRe: Combining Data From Temp Tables Pin
Jörgen Andersson29-Jan-13 3:02
memberJörgen Andersson29-Jan-13 3:02 
GeneralRe: Combining Data From Temp Tables Pin
Jörgen Andersson28-Jan-13 22:28
memberJörgen Andersson28-Jan-13 22:28 
Question[VB.net+ADO.net]how can combobox 1 control the result of combobox2 Pin
Achilles8428-Jan-13 8:20
memberAchilles8428-Jan-13 8:20 
AnswerRe: [VB.net+ADO.net]how can combobox 1 control the result of combobox2 Pin
Achilles8430-Jan-13 3:47
memberAchilles8430-Jan-13 3:47 
QuestionSMO Retrieve Table Record Pin
savbace28-Jan-13 2:31
membersavbace28-Jan-13 2:31 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 2:42
mvpSandeep Mewara28-Jan-13 2:42 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 2:55
membersavbace28-Jan-13 2:55 
QuestionRe: SMO Retrieve Table Record Pin
Eddy Vluggen28-Jan-13 3:21
mvpEddy Vluggen28-Jan-13 3:21 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 3:22
mvpSandeep Mewara28-Jan-13 3:22 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 3:40
membersavbace28-Jan-13 3:40 
Questionhow can reporting in this Situation Pin
karimkpg26-Jan-13 2:38
memberkarimkpg26-Jan-13 2:38 
AnswerRe: how can reporting in this Situation Pin
Sandeep Mewara26-Jan-13 6:02
mvpSandeep Mewara26-Jan-13 6:02 

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
Web02 | 2.8.150731.1 | Last Updated 31 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid