View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Join between tables - ProjeQtOr
 
 

Join between tables

More
27 Mar 2013 11:25 #1 by imenkolsi
Hi again,
I'de like to join between n tables

I want to do with just one query that will returns all the result


For example between the table resource and the table work

i'd like to get for each resource its work


I don't want to have many queries : one to get all the resources and another query to

get the work for each one.


Would u help me ?

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 11:30 #2 by babynus
Replied by babynus on topic Re: Join between tables
Something like this ?
select resource.fullname, sum(work.work)
from resource, work
where resource.id=work.idResource
group by resource.fullname

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 11:39 #3 by imenkolsi
Replied by imenkolsi on topic Re: Join between tables
Actually i'm looking for something like this

SELECT r.id, r.fullname, r.email, w.work
FROM resource r
LEFT JOIN WORK w ON r.id = w.idResource
GROUP BY r.name

Could u tell me how can i get this one with one from your sql methods ?


other wise, can i use directly this query on the code ? if yes would u tell me

how ?

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 11:50 #4 by babynus
Replied by babynus on topic Re: Join between tables
$query='SELECT r.id, r.fullname, r.email, w.work'
.' FROM resource r'
.' LEFT JOIN WORK w ON r.id = w.idResource'
.' GROUP BY r.name';
$result=Sql::query($query);

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 12:01 #5 by imenkolsi
Replied by imenkolsi on topic Re: Join between tables
Thank you :) every thing works really fine

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.043 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.