View Single Post
 
Old October 7th, 2003, 01:02 AM
mateenmohd mateenmohd is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default data retrieve from three tables

How can retrieve the data from three tables ?

Table1 stations column name stn_no, rec_id
Table2 software column name stn_no, rec_id, software
Table3 softwarelist colume name version, rec_id

rec_id means record id.
I could not retrieve the actual version of each software from table,
because in third table ie. Softwarelist there is stn_no column not exit.

Data like this

Stn_no rec_id software version
---- ------- -------- ------------
Comp1 1 Windows XP 1ST edition
Comp1 2 Windows 2000 2nd edition
Comp1 3 Windows 98 2nd editon
Comp2 4 Adobe 1st editon
Comp2 5 AutoCAD 2nd edition
Comp3 6 3D Studio MAX 4.2
Comp3 7 ARC View 8
………

I use following query

select stations.rec_id,stations.stn_no,softwarelist.rec_i d,software.software,softwarelist.version from stations,software,softwarelist where stations.stn_no=software.stn_no and stations.rec_id=softwarelist.rec_id and stations.stn_no='comp1'

problem in version column, it is display same version of each software why ?
it should display software’s and it separate version


Mateen