MySQL Forums
Forum List  »  Newbie

Calculation based on three tables
Posted by: Warren Nicholson
Date: January 20, 2009 03:59PM

I have 3 tables `Manifest`,Exporter` & `Importer`.
SELECT
Manifest.`MAN-ID`
Manifest.`Exporter`,
Manifest.`Importer`,
Manifest.Billing, [NB. dropdown menu exporter & importer]
Manifest.`Collect Zone A`, [NB. this will be a radio button]
Manifest.`Deliver Zone A` [NB. this will be a radio button]
FROM
Manifest

SELECT
`Exporter`.`EXP-ID`
`Exporter`.`Co Name`,
`Exporter`.`Collect Zone A`,
`Exporter`.`Deliver Zone A`
FROM
`Exporter`

SELECT
`Importer`.`IMP-ID`
`Importer`.`Co Name`,
`Importer`.`Collect Zone A`,
`Importer`.`Deliver Zone A`
FROM
`Importer`

When I insert a record into `Manifest` at the billing column I will put in either exporter or importer. This column will decide who pays for the cargo. If importer is inserted the query will get importer's rate/Collect Zone A (depending which radio buttons selected) and be charged accordingly. Basically I see the billing column as the comparator between exporter & importer. N.B there are many exporters & importers & everyone have unique rates.

Hope I described this scenario correctly.

Thanks

Warren

Options: ReplyQuote


Subject
Written By
Posted
Calculation based on three tables
January 20, 2009 03:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.