Ask a Question related to Coldfusion Database Access, Design and Development.
-
jjrmy1 #1
inner join
need some help with some sql I can't seem to get the syntax right. I've tried several but to no avail the one below gets me the
closest but I can't get the guardians records pulled.
SELECT SUM(tuition)
FROM child INNER JOIN guardian ON guardian.ID = child.child_ID
I would like the results to show the records from the guardian table as well
tables:
GUARDIAN
fields:
ID
guardian1_first
guardian1_last
CHILD
fields:
ID
child_ID
first_name
last_name
tuition
relationship: guardian.ID = child.child_ID
results should show:
guardian1_first, guardian1_last, and the SUM(child.tuition) for all children where the child_ID is equal to the ID of guardian
listed
any help would be much appreciated, I've been driving myself mad with this
jjrmy1 Guest
-
Is left-join faster then inner join?
Some people said that using left-join is generally faster than inner join, is that true? Thanks... -
JOIN vs no JOIN
Is there any benefit in doing: SELECT a.f1, a.f2, b.f3 FROM t1 a INNER JOIN t2 b ON a.f1=b.id WHERE a.f1> 0 rather than SELECT a.f1, a.f2,... -
Is self-join appropriate?
Please forgive me if this post is too long. I was trying to solve this (probably simple) issue for all day but I'm not as good in SQL as I thought... -
SQL join
I am trying to join three acess tables in a recordset and trying to acess their their contents. for ex . if we have a customer table having fields... -
How to Join...
I have two tables TableA Name, DeptNum, SubDeptNum JDoe, 1001, 1004 TableB Number, Name -
cgsj_usa@yahoo.com #2
Re: inner join
All you have to do is include the columns in the select statement, like below.
select guardian1_first, guardian1_last, and the SUM(child.tuition)
from guardian inner join child
on guardian.id = child.childid
group by guardian1_last, guardian1_first
You will have to include a group by statement, as I did above, since there is
an aggregate function in the select statement.
Hope that this helps. Thanks.
Chris
cgsj_usa@yahoo.com Guest



Reply With Quote

