Click here to Skip to main content
15,917,875 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to spread traffic on a table Pin
Johan Hakkesteegt22-Mar-11 3:40
Johan Hakkesteegt22-Mar-11 3:40 
AnswerRe: How to spread traffic on a table Pin
darkelv22-Mar-11 22:18
darkelv22-Mar-11 22:18 
QuestionSum of all rows Pin
CodingLover21-Mar-11 19:22
CodingLover21-Mar-11 19:22 
AnswerRe: Sum of all rows Pin
Wendelius21-Mar-11 19:50
mentorWendelius21-Mar-11 19:50 
GeneralRe: Sum of all rows Pin
CodingLover21-Mar-11 22:59
CodingLover21-Mar-11 22:59 
GeneralRe: Sum of all rows Pin
Wendelius22-Mar-11 2:12
mentorWendelius22-Mar-11 2:12 
GeneralRe: Sum of all rows Pin
CodingLover22-Mar-11 18:27
CodingLover22-Mar-11 18:27 
QuestionSelecting one record from one table and multiple from second table Pin
Dominick Marciano21-Mar-11 13:54
professionalDominick Marciano21-Mar-11 13:54 
My company has a project database that has numerous columns. We track everything between tables with the project number, but because of how screwed up in the past the database got there is another column which is actually the primary keys called OrderStatusID. So if I want to navigate forward through the records I use the following SQL statement:
SELECT TOP 1 * FROM [Order Status] WHERE OrderStatusID > " & CurrentRecordID & " ORDER BY OrderStatusID"


Now there is another table that holds certificates for the projects. A project may have zero to many certificates. So I was trying to use the SQL statement:
SELECT TOP 1 * FROM [Order Status] LEFT JOIN Lead_Free_Certs ON (CAST([Order Status].[Project #] AS nvarchar(255)) = Lead_Free_Certs.[Project Num]) WHERE (OrderStatusID > " & CurrentRecordID & ") ORDER BY OrderStatusID, Lead_Free_Certs.[Cert Num] DESC


However if a site has more then one certificate, only the first one is returned because of the SELECT TOP 1 statement. How can this statement be modified so that it would return one row form the [Order Status] table and multiple rows from the Lead_Free_Certs table? Is this even possible? Please keep in mind that because of the way the database was set up the SELECT TOP 1 (or something similar) must remain in place because I finding the next highest OrderStatusID. Thanks in advanced for any help.
AnswerRe: Selecting one record from one table and multiple from second table Pin
RyanEK21-Mar-11 14:44
RyanEK21-Mar-11 14:44 
GeneralRe: Selecting one record from one table and multiple from second table Pin
Dominick Marciano21-Mar-11 15:21
professionalDominick Marciano21-Mar-11 15:21 
GeneralRe: Selecting one record from one table and multiple from second table Pin
Dominick Marciano21-Mar-11 15:35
professionalDominick Marciano21-Mar-11 15:35 
QuestionPlease Interview Me Pin
Nagy Vilmos21-Mar-11 10:55
professionalNagy Vilmos21-Mar-11 10:55 
AnswerRe: Please Interview Me Pin
Simon_Whale21-Mar-11 23:12
Simon_Whale21-Mar-11 23:12 
GeneralRe: Please Interview Me Pin
Nagy Vilmos21-Mar-11 23:37
professionalNagy Vilmos21-Mar-11 23:37 
GeneralRe: Please Interview Me Pin
Simon_Whale21-Mar-11 23:43
Simon_Whale21-Mar-11 23:43 
AnswerRe: Please Interview Me Pin
Johan Hakkesteegt21-Mar-11 23:37
Johan Hakkesteegt21-Mar-11 23:37 
AnswerRe: Please Interview Me Pin
Corporal Agarn22-Mar-11 1:32
professionalCorporal Agarn22-Mar-11 1:32 
AnswerRe: Please Interview Me Pin
Wendelius22-Mar-11 2:28
mentorWendelius22-Mar-11 2:28 
AnswerRe: Please Interview Me Pin
Prasanta_Prince15-Apr-11 0:56
Prasanta_Prince15-Apr-11 0:56 
QuestionSQLServer 2008 Express to Standard Upgrade Pin
Tim Carmichael21-Mar-11 8:27
Tim Carmichael21-Mar-11 8:27 
AnswerRe: SQLServer 2008 Express to Standard Upgrade Pin
Wendelius21-Mar-11 9:41
mentorWendelius21-Mar-11 9:41 
AnswerRe: SQLServer 2008 Express to Standard Upgrade Pin
PIEBALDconsult21-Mar-11 18:48
mvePIEBALDconsult21-Mar-11 18:48 
AnswerRe: SQLServer 2008 Express to Standard Upgrade Pin
Roger Wright21-Mar-11 19:42
professionalRoger Wright21-Mar-11 19:42 
QuestionConnect Dababase from Windows7 to windows 2008 Pin
buffering8321-Mar-11 4:59
buffering8321-Mar-11 4:59 
AnswerRe: Connect Dababase from Windows7 to windows 2008 Pin
Simon_Whale21-Mar-11 5:23
Simon_Whale21-Mar-11 5:23 

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.