Advertisement

07.08.2008 at 06:50PM PDT, ID: 23548882
[x]
Attachment Details

I'm guessing...  use a join?

Asked by Attabui in MySQL, PHP and Databases, SQL Query Syntax

Tags: mysql

So, I'm trying to learn more about complex queries, and I have a feeling the result for this question is going to end up as a short tutorial in joins.  I'll use generic info here.

Let's say I have three tables:

table: PEOPLE
fields: id, fullname, email, phone

table: ERROR_TYPES
fields: id, short_desc, long_desc, send_email

table: ERRORS
fields: id, person_id, error_type_id, date

I'd like to run a single query that returns all rows in ERRORS, but rather than returning the person_id and error_type_id stored in the table, it returns the fullname from PEOPLE and the short_desc from ERROR_TYPES associated with those ids.

Any assistance in understanding how such a query would work would be very helpful.

Thank you!
~MikeyStart Free Trial
[+][-]07.08.2008 at 07:07PM PDT, ID: 21960089

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 07:07PM PDT, ID: 21960091

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.08.2008 at 07:11PM PDT, ID: 21960113

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MySQL, PHP and Databases, SQL Query Syntax
Tags: mysql
Sign Up Now!
Solution Provided By: Kdo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.08.2008 at 07:13PM PDT, ID: 21960116

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628