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 > Data Access, Manipulation & Batch Languages > ASP > Asp sql ??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-25-04, 04:58
Max30 Max30 is offline
Registered User
 
Join Date: May 2004
Posts: 6
Asp sql ??

Hello there!

I got this problem which I cant solve by myself!


after raning this sql i m getting some double values

999666 IT Organisations Autumn
999666 IT Organisations Autumn
999666 IT Organisations Autumn

can anyone explan why?

<%
sID=request.querystring("staff")

set myConnection=server.createobject("ADODB.connection ")
myConnection.open "Outline", "IWSDStudent", "mill"

mySQL = "select distinctrow semester.semester,coordination.unitID, unit.unitname,staff.name FROM semester, coordination, unit, staff where "
mySQL = mySQL & "coordination.staffID = " & sID & " and "
mySQL = mySQL & "unit.unitID=coordination.unitID and "
mySQL = mySQL & "coordination.staffID =staff.staffID"

set myRS = myConnection.execute(mySQL)
%>




Unit ID Unit Name Semester
999888 XYZ Analysis Autumn
999777 Resource Waste Optimisation Autumn
999666 IT Organisations Autumn
999666 IT Organisations Autumn
999666 IT Organisations Autumn
999888 XYZ Analysis Spring
999777 Resource Waste Optimisation Spring
999666 IT Organisations Spring
999666 IT Organisations Spring
999666 IT Organisations Spring
999888 XYZ Analysis Summer
999777 Resource Waste Optimisation Summer
999666 IT Organisations Summer
999666 IT Organisations Summer
999666 IT Organisations Summer
Reply With Quote
  #2 (permalink)  
Old 05-25-04, 10:37
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
You have data coming from 4 tables (semester, coordination, unit, and staff), but you have only two joins (unit.unitID = coordination.unitIT and coordination.staffID = staffID). What about semester? You should have joins for every table. That would be my initial guess...
__________________
That which does not kill me postpones the inevitable.
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On