Hi All,

Does anyone know if this can be done with one query?

I have to create a chart based on info in two tables that are four tables
apart.

Here are the relevant tables and just the most relevant fields...

accident_report
- ID
- weekending  (this is a YYYY-MM-DD format date)
- (and others)

accident_data
- ID
- accident_report_id
- (and others)

accident_cause  (a lookup table)
- ID
- accident_data_id
- cause_id

cause   (a list of possible causes of accidents ie. "falling object" or
"electric shock"
- ID
- Description


I need to list all the causes with the number of times each has occurred,
even if it's zero times... they don't need to be listed in any particular
order...

Cheers

Simon Kimber


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to