If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > sql table join problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-04, 10:39
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
sql table join problem

hi i am very new to sql and have i problem i would like to solve with your help i have 2 tables, module (modid, courseid, name, tutorid, assessments) and modresults (modid, studentid, assessmentno, url, grade, tutorcomment). what i want to do is write a query so that all the module results are displayed for a particular tutorid.
what i have so far is.

select *
from e modresults, d module
where e.modid = d.modid and staffid ="1" //for the case that we want to see staffid 1's results

where am i going wrong.
please help
Reply With Quote
  #2 (permalink)  
Old 04-28-04, 11:07
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
Since this is an assignment, I'd suggest that you check the part about
Code:
staffid="1"
just to see if that is what you really meant.

-PatP
Reply With Quote
  #3 (permalink)  
Old 04-28-04, 11:19
evilz35 evilz35 is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
this is'nt an assignment this is just a exercise from the "introduction to oracle9i:sql" book which shows a different set of results. please can some one help
Reply With Quote
  #4 (permalink)  
Old 04-28-04, 12:22
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Quote:
select *
from e modresults, d module
where e.modid = d.modid and staffid ="1"
1) do not use select *, actually name the columns you want to display
2) you don't have tables e and d, you have tables modresults and module
so you need to say modresults e, module d
3) don't use quotes around the 1 in staffid.

See where that gets you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On