Beedge
05-30-2007, 04:27 AM
Hi,
I have 3 tables:
alerts:
id
category
location
category
id
category_name
location
id
location_name
Say the tables are filled:
Alerts
Id = 1
category = 3
location = 2
Category
id = 1
category_name = residential
id = 2
category_name = new developments
id = 3
category_name = agricultural
id = 4
category_name = commercial
Location
id = 1
location_name = Cork
id = 2
location_name = Kerry
id = 3
location_name = Dublin
id = 4
location_name = Limerick
What statement would I use to ouput from the alerts table:
alert_id = 1
category_name = Agriclutural
location_name = Kerry
Ive seen tutorials on using JOIN but Im a bit confused as to how you would join 3 or more tables in the statement.
I dont neccessarily need any one to code this but a good tutorial or link would be appreciated, although if someone wants tell me what the select statement would be thats cool too :)
Thanks
Beedge
I have 3 tables:
alerts:
id
category
location
category
id
category_name
location
id
location_name
Say the tables are filled:
Alerts
Id = 1
category = 3
location = 2
Category
id = 1
category_name = residential
id = 2
category_name = new developments
id = 3
category_name = agricultural
id = 4
category_name = commercial
Location
id = 1
location_name = Cork
id = 2
location_name = Kerry
id = 3
location_name = Dublin
id = 4
location_name = Limerick
What statement would I use to ouput from the alerts table:
alert_id = 1
category_name = Agriclutural
location_name = Kerry
Ive seen tutorials on using JOIN but Im a bit confused as to how you would join 3 or more tables in the statement.
I dont neccessarily need any one to code this but a good tutorial or link would be appreciated, although if someone wants tell me what the select statement would be thats cool too :)
Thanks
Beedge