Click here to Skip to main content
15,891,136 members
Home / Discussions / Database
   

Database

 
QuestionSort without duplicates Pin
denpsia21-Dec-05 13:20
denpsia21-Dec-05 13:20 
AnswerRe: Sort without duplicates Pin
toxcct21-Dec-05 21:47
toxcct21-Dec-05 21:47 
GeneralRe: Sort without duplicates Pin
denpsia22-Dec-05 13:09
denpsia22-Dec-05 13:09 
GeneralRe: Sort without duplicates Pin
toxcct22-Dec-05 21:11
toxcct22-Dec-05 21:11 
GeneralRe: Sort without duplicates Pin
denpsia26-Dec-05 12:53
denpsia26-Dec-05 12:53 
QuestionSql Pin
Mfirdous21-Dec-05 11:18
Mfirdous21-Dec-05 11:18 
AnswerRe: Sql Pin
Colin Angus Mackay22-Dec-05 8:36
Colin Angus Mackay22-Dec-05 8:36 
QuestionHorizontal merge Pin
djsdjsdjsdjs21-Dec-05 7:20
djsdjsdjsdjs21-Dec-05 7:20 
How do you write a query that horizontally merges records from different tables? For example, say I have Person, Phone, and Email tables where Phone and Email have foreign key relationships to the Person table, and store 0 to n email and phone records for each person record.

The result query should include the person's name, all email addresses and all phone numbers, and the email addresses and phone numbers should be listed "side by side". To illustrate in CSV format;
--------------------------------------------------------------
LName, FName, EmailAddress, PhoneNumber
Jones, Sue, sjones@nowhere.com, 123-555-0203
Jones, Sue, sj@somewhere.com, 098-555-2382
Jones, Sue, SueJones@AspenState.com, NULL
Smith, Joe, jsmith@nowhere.com, 123-555-0202
Smith, Joe, js@home.com, 098-555-2382
Smith, Joe, NULL, 230-555-3298
Smith, Joe, NULL, 234-555-0982
Washington, Peter, NULL, NULL
...
--------------------------------------------------------------
In this example Sue has more email records than phone records, so the third record in the result set is NULL for the PhoneNumber field. Similarly, Joe has more email records than phone records so rows 6 and 7 have NULL for the EmailAddress field. Finally Peter has no email or phone records so both PhoneNumber and EmailAddress are NULL.

Any ideas? Thanks
AnswerRe: Horizontal merge Pin
denpsia21-Dec-05 13:24
denpsia21-Dec-05 13:24 
GeneralRe: Horizontal merge Pin
djsdjsdjsdjs22-Dec-05 3:22
djsdjsdjsdjs22-Dec-05 3:22 
AnswerRe: Horizontal merge [edited] Pin
toxcct21-Dec-05 21:50
toxcct21-Dec-05 21:50 
GeneralRe: Horizontal merge Pin
djsdjsdjsdjs22-Dec-05 3:36
djsdjsdjsdjs22-Dec-05 3:36 
GeneralRe: Horizontal merge [edited] Pin
toxcct22-Dec-05 3:38
toxcct22-Dec-05 3:38 
QuestionADO.NET and mdb embedded query Pin
Sasuko21-Dec-05 6:16
Sasuko21-Dec-05 6:16 
AnswerRe: ADO.NET and mdb embedded query Pin
S. Akif Kamal27-Dec-05 20:36
S. Akif Kamal27-Dec-05 20:36 
QuestionUse Time-Only in query (with parameters) Pin
BenKona20-Dec-05 7:18
BenKona20-Dec-05 7:18 
AnswerRe: Use Time-Only in query (with parameters) Pin
anandss20-Dec-05 8:27
anandss20-Dec-05 8:27 
Questionserver and db report in asp Pin
karanba19-Dec-05 23:22
karanba19-Dec-05 23:22 
QuestionParameters in access connection Pin
Sasuko19-Dec-05 12:51
Sasuko19-Dec-05 12:51 
AnswerRe: Parameters in access connection Pin
MalikRizwan19-Dec-05 17:44
MalikRizwan19-Dec-05 17:44 
AnswerRe: Parameters in access connection Pin
MyNothing19-Dec-05 19:47
MyNothing19-Dec-05 19:47 
GeneralRe: Parameters in access connection Pin
Sasuko19-Dec-05 23:33
Sasuko19-Dec-05 23:33 
GeneralRe: Parameters in access connection Pin
MalikRizwan20-Dec-05 1:29
MalikRizwan20-Dec-05 1:29 
QuestioneVC++ 4.0 to SQL Server 2000 Pin
rbrad1234519-Dec-05 6:58
rbrad1234519-Dec-05 6:58 
QuestionDo SQL Server Views take Parameters??? Pin
code-frog19-Dec-05 6:52
professionalcode-frog19-Dec-05 6:52 

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.