PDA

View Full Version : Referencing a second table


AndyJ
16.06.2004, 23:56
Hey all,

I've run into a halt in my thinking process !

I am developing a component, part of which displays a list of results from a table. One of the fields in the table is country_id which is a number, referencing a row in a countries table.

How can I display the country name from the other table, rather than just the id number ?

many thanks

AndyJ

zorkhh
17.06.2004, 00:06
Hi,


select table1.country_id, table2.country_name from table1, table2 where table1.country_id=table2.country_id ...


hth

Zork

AndyJ
17.06.2004, 01:03
Thanks 4 that. I had a complete mental block, got it working a treat now.

AndyJ