Click here to Skip to main content
15,920,110 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL View returning different results Pin
Mycroft Holmes24-May-11 22:52
professionalMycroft Holmes24-May-11 22:52 
AnswerRe: SQL View returning different results Pin
S Douglas8-Jun-11 5:42
professionalS Douglas8-Jun-11 5:42 
QuestionSQL Server 2008 Import Data Pin
Zeyad Jalil24-May-11 19:59
professionalZeyad Jalil24-May-11 19:59 
AnswerRe: SQL Server 2008 Import Data Pin
abcurl24-May-11 22:17
abcurl24-May-11 22:17 
AnswerRe: SQL Server 2008 Import Data Pin
Mycroft Holmes24-May-11 22:49
professionalMycroft Holmes24-May-11 22:49 
AnswerRe: SQL Server 2008 Import Data Pin
SilimSayo25-May-11 3:49
SilimSayo25-May-11 3:49 
AnswerRe: SQL Server 2008 Import Data Pin
jschell25-May-11 10:24
jschell25-May-11 10:24 
QuestionUsing wildcard character Pin
Member 455049324-May-11 0:35
Member 455049324-May-11 0:35 
AnswerRe: Using wildcard character Pin
Pete O'Hanlon24-May-11 0:43
mvePete O'Hanlon24-May-11 0:43 
AnswerRe: Using wildcard character Pin
abcurl24-May-11 22:20
abcurl24-May-11 22:20 
QuestionSimple SQL format question Pin
Enochs23-May-11 5:21
Enochs23-May-11 5:21 
AnswerRe: Simple SQL format question Pin
David Mujica23-May-11 5:23
David Mujica23-May-11 5:23 
GeneralRe: Simple SQL format question Pin
Enochs23-May-11 6:36
Enochs23-May-11 6:36 
QuestionLinkedIn's database Pin
Jassim Rahma23-May-11 2:08
Jassim Rahma23-May-11 2:08 
AnswerRe: LinkedIn's database Pin
R. Giskard Reventlov23-May-11 2:11
R. Giskard Reventlov23-May-11 2:11 
AnswerRe: LinkedIn's database Pin
Pete O'Hanlon23-May-11 2:59
mvePete O'Hanlon23-May-11 2:59 
GeneralRe: LinkedIn's database Pin
wizardzz24-May-11 10:50
wizardzz24-May-11 10:50 
QuestionmySQL on 64bit Pin
Jassim Rahma22-May-11 3:35
Jassim Rahma22-May-11 3:35 
QuestionSQL Server Connection Failure Pin
εїзεїзεїз21-May-11 22:47
εїзεїзεїз21-May-11 22:47 
AnswerRe: SQL Server Connection Failure Pin
GenJerDan22-May-11 4:13
GenJerDan22-May-11 4:13 
QuestionGroup By All Columns except the image field Pin
Vimalsoft(Pty) Ltd21-May-11 9:00
professionalVimalsoft(Pty) Ltd21-May-11 9:00 
AnswerRe: Group By All Columns except the image field Pin
Vimalsoft(Pty) Ltd21-May-11 9:44
professionalVimalsoft(Pty) Ltd21-May-11 9:44 
GeneralRe: Group By All Columns except the image field Pin
Shameel25-May-11 8:20
professionalShameel25-May-11 8:20 
Alternatively, you can use this. I'm assuming that the column PHOTO is in the USER table. I see that some of the columns in the query have not been prefixed with an alias, it is always a better practise to prefix all column names with alias, it improves performance too...

SQL
SELECT      
K.KIDID,      
K.STUDENTNUMBER,      
KIDNAME,      
KIDLASTNAME ,      
SC.SCHOOLNAME ,      
KIDGRADE ,      
KIDCLASS ,      
SC.SCHOOLID,  
k.TEMP_BARCODE,
(SELECT PHOTO FROM USER UP WHERE U.USERID = UP.USERID) AS PHOTO,
A.ACCOUNTID
,SUM(TRANSACTION_AMOUNT) AS [BALANCE]  
FROM       
KIDS_DETAILS K      
INNER JOIN SCHOOL SC       
ON K.SCHOOLID = SC.SCHOOLID      
INNER JOIN PARENTKID PK       
ON PK.KIDID = K.KIDID
INNER JOIN USERS U 
ON U.USERID  = K.USERID 
INNER JOIN ACCOUNTS A 
ON A.USERID = U.USERID
INNER JOIN ACCOUNTRANSATIONS AT
ON AT.ACCOUNTID  = A.ACCOUNTID
LEFT OUTER JOIN KIDSPHOTO KP
ON KP.KIDID = K.KIDID
 
  GROUP BY
K.KIDID,      
K.STUDENTNUMBER,      
KIDNAME,      
KIDLASTNAME ,      
SC.SCHOOLNAME ,      
KIDGRADE ,      
KIDCLASS ,      
SC.SCHOOLID,  
k.TEMP_BARCODE,
A.ACCOUNTID

QuestionDataset folder Pin
paper6721-May-11 5:59
paper6721-May-11 5:59 
AnswerRe: Dataset folder Pin
Eddy Vluggen23-May-11 0:25
professionalEddy Vluggen23-May-11 0:25 

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.