p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: SQL to retrieve data from different tables


Message #1 by "COCO LUA SUAT CHOO" <cocolua@h...> on Fri, 22 Jun 2001 02:10:11
http://w3.one.net/~jhoffman/sqltut.htm
for an SQL tutorial

You are probably looking for INNER JOIN - join the tables together.

SELECT ...
FROM table1
INNER JOIN table2
ON table1.table1ID = table2.table1.ID
INNER JOIN table3
ON table2.table2.ID = table3.table2.ID
WHERE table1.table1ID = Requet.QueryString(whatever)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "COCO LUA SUAT CHOO" <cocolua@h...>
To: "Code Clinic" <proasp_codeclinic@p...>
Sent: Friday, June 22, 2001 2:10 AM
Subject: [proasp_codeclinic] SQL to retrieve data from different tables


:
:
: Hi! How do i write to retreieve the record for the below case:
: I have 3 table which are Attendees,Staff,and Course, i need to display the
: record extracted from this 3 files where Attendees.NRIC 
: Request.Querystring("whetever"), the Attendees.AttNRIC = Staff.NRIC (coz
the
: other detail is atcually kept in the Staff, file, the common key is
atcually
: the is NRIC/AttNRIC and the last 1, the Course.ClassCode 
: Attendees.ClassCode.
: I tried to use the SELECT stmt with two AND conditions but it doesn't
work,
: any one can help me in this! Thanks a lot for spending time reading my
mail!



  Return to Index