Welcome Guest, Not a member yet? Register   Sign In
Mysql query question
#1

[eluser]megabyte[/eluser]
Two tables

People

personID | name
-----------------
1 Bob
2 Rick


Jobs

jobID | personID | jobtitle
-----------------------------
1 1 Baker
2 1 Painter
3 2 Cook
4 1 Welder



I want to query both tables and find out all the jobs Bob has and combine like this



personID | name | jobID | jobtitle
-----------------------------------------
1 Bob 1,2,4 Banker, Painter, Welder




*** Notice how only one row is returned based on the People table then the job id and job titles which have multiple rows found in the Jobs table and stored in a single column each seperated with a comma.


What I don't want is what I do know how to do which is a regualr join and get this

personID | name | jobID | jobtitle
-----------------------------------------
1 Bob 1 Banker
1 Bob 2 Painter
1 Bob 4 Welder


Someone please help? Tongue


Messages In This Thread
Mysql query question - by El Forum - 05-28-2009, 04:23 PM
Mysql query question - by El Forum - 05-28-2009, 05:35 PM
Mysql query question - by El Forum - 05-28-2009, 05:42 PM
Mysql query question - by El Forum - 05-29-2009, 11:48 AM
Mysql query question - by El Forum - 05-29-2009, 01:19 PM
Mysql query question - by El Forum - 05-29-2009, 10:19 PM
Mysql query question - by El Forum - 05-30-2009, 04:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB