Click here to Skip to main content
14,635,719 members
Home » Discussions » Database
   

Database

 
QuestionHow to speedup the execution of a query in Sql Server? Pin
Abhijit Mindcraft22-Aug-16 22:52
MemberAbhijit Mindcraft22-Aug-16 22:52 
AnswerRe: How to speedup the execution of a query in Sql Server? Pin
Mycroft Holmes22-Aug-16 23:11
professionalMycroft Holmes22-Aug-16 23:11 
AnswerRe: How to speedup the execution of a query in Sql Server? Pin
David Mujica23-Aug-16 5:35
MemberDavid Mujica23-Aug-16 5:35 
GeneralRe: How to speedup the execution of a query in Sql Server? Pin
Abhijit Mindcraft23-Aug-16 19:58
MemberAbhijit Mindcraft23-Aug-16 19:58 
GeneralRe: How to speedup the execution of a query in Sql Server? Pin
Mycroft Holmes23-Aug-16 20:20
professionalMycroft Holmes23-Aug-16 20:20 
AnswerRe: How to speedup the execution of a query in Sql Server? Pin
Eddy Vluggen24-Aug-16 4:09
professionalEddy Vluggen24-Aug-16 4:09 
GeneralRe: How to speedup the execution of a query in Sql Server? Pin
Abhijit Mindcraft24-Aug-16 18:57
MemberAbhijit Mindcraft24-Aug-16 18:57 
QuestionBasic Join Not Working (Copy From LAMP Forum) Pin
Django_Untaken19-Aug-16 2:18
MemberDjango_Untaken19-Aug-16 2:18 
Hello there. I am trying to get data from 3 different tables based on simple join. One of the tables can have multiple values against one primary key. Here are the table designs

Table 1 - EmployeeDetails
EmployeeId INT, FirstName VARCHAR, SurName VARCHAR, SexId INT 
Table 2 - EmployeeSex
SexId INT, Sex VARCHAR
-- Values inserted
-- 1, Male
-- 2, Female
Table 3 - EmployeeContacts
EmployeeId INT, Contact VARCHAR -- may or may not be null AND can contain multiple values
I am using following query
SELECT ED.EmployeeId, ED.FirstName, ED.SurName, GROUP_CONCAT(EC.Contact) 
FROM EmployeeDetails ED, EmployeeSex ES, EmployeeContacts EC
WHERE ED.SexId = ES.SexId AND ED.EmployeeId = EC.EmployeeId AND ED.EmployeeId = 'emp_password';
Now this query works fine if we have at least one contact number. But if there are not contacts, then this results in empty set. What is wrong with this query ? How can I improve so that it works in all scenarios (regardless of number of contacts in EmployeeContacts table). Thanks for any input.
AnswerRe: Basic Join Not Working (Copy From LAMP Forum) Pin
Chris Quinn19-Aug-16 2:34
MemberChris Quinn19-Aug-16 2:34 
Questionpostgresql or mysql? Pin
Member 907660914-Aug-16 20:21
MemberMember 907660914-Aug-16 20:21 
AnswerRe: postgresql or mysql? Pin
Richard MacCutchan14-Aug-16 21:29
mveRichard MacCutchan14-Aug-16 21:29 
AnswerRe: postgresql or mysql? Pin
Tim Carmichael15-Aug-16 10:22
MemberTim Carmichael15-Aug-16 10:22 
AnswerRe: postgresql or mysql? Pin
Eddy Vluggen15-Aug-16 14:22
professionalEddy Vluggen15-Aug-16 14:22 
AnswerRe: postgresql or mysql? Pin
Jörgen Andersson15-Aug-16 21:27
professionalJörgen Andersson15-Aug-16 21:27 
AnswerRe: postgresql or mysql? Pin
jonyj8-Sep-16 10:20
Memberjonyj8-Sep-16 10:20 
QuestionError when passing multiple values Pin
Jassim Rahma12-Aug-16 12:53
MemberJassim Rahma12-Aug-16 12:53 
AnswerRe: Error when passing multiple values Pin
Mycroft Holmes12-Aug-16 14:21
professionalMycroft Holmes12-Aug-16 14:21 
GeneralRe: Error when passing multiple values Pin
Jassim Rahma13-Aug-16 5:32
MemberJassim Rahma13-Aug-16 5:32 
GeneralRe: Error when passing multiple values Pin
Richard MacCutchan13-Aug-16 6:03
mveRichard MacCutchan13-Aug-16 6:03 
GeneralRe: Error when passing multiple values Pin
Jassim Rahma13-Aug-16 7:08
MemberJassim Rahma13-Aug-16 7:08 
GeneralRe: Error when passing multiple values Pin
Richard MacCutchan13-Aug-16 8:29
mveRichard MacCutchan13-Aug-16 8:29 
GeneralRe: Error when passing multiple values Pin
Jassim Rahma13-Aug-16 11:12
MemberJassim Rahma13-Aug-16 11:12 
GeneralRe: Error when passing multiple values Pin
Victor Nijegorodov13-Aug-16 11:15
MemberVictor Nijegorodov13-Aug-16 11:15 
GeneralRe: Error when passing multiple values Pin
Jassim Rahma13-Aug-16 11:21
MemberJassim Rahma13-Aug-16 11:21 
GeneralRe: Error when passing multiple values Pin
Mycroft Holmes13-Aug-16 14:04
professionalMycroft Holmes13-Aug-16 14:04 

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.