[Show all top banners]

Maha-Sakti

More by Maha-Sakti
What people are reading
Subscribers
:: Subscribe
Back to: Kurakani General Refresh page to view new replies
 Any SQL Gurus Around?
[VIEWED 903 TIMES]
SAVE! for ease of future access.
Posted on 10-27-04 8:34 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Alright all you SQL gurus, I have a little SQL problem, and would like to seek for help.

In the following code, only the classes with class instructor assigned gets showed. I am looking for classes whether or not instrutor is assigned. So that means a LEFT JOIN between Table A and Table E. But I have lost track of how to handle other keys between these two tables. Any help would be greatly appreciated.

SELECT a.class_nbr
, a.subject
, a.catalog_nbr
, a.class_section
, a.descr
, a.campus
, a.crse_id
, a.crse_offer_nbr
, a.strm
, a.session_code
, a.enrl_cap
, a.enrl_tot
, a.enrl_stat
, b.mon
, b.tues
, b.wed
, b.thurs
, b.fri
, b.sat
, b.sun
, b.meeting_time_start
, b.meeting_time_end
, b.facility_id
, d.room_chrstc
, e.emplid
, f.last_name
, f.first_name
, a.acad_group
, g.descrshort AS acad_org
FROM lsapro.ps_class_tbl a
, lsapro.ps_class_instr e
, lsapro.ps_personal_data f
, lsapro.ps_ua_acad_org_vw g
, lsapro.ps_class_mtg_pat b LEFT OUTER JOIN lsapro.ps_ua_facil_chr_vw d ON
d.facility_id=b.facility_id
AND d.room_chrstc IN ('30'
, '31'
, '32'
, '33'
, '34')
WHERE a.class_stat <> 'X'
AND b.crse_id=a.crse_id
AND b.crse_offer_nbr=a.crse_offer_nbr
AND b.strm=a.strm
AND b.session_code=a.session_code
AND b.class_section=a.class_section
AND e.crse_id = a.crse_id
AND e.instr_role='PI'
AND e.crse_offer_nbr = a.crse_offer_nbr
AND e.strm = a.strm
AND e.session_code = a.session_code
AND e.class_section = a.class_section
AND e.emplid=f.emplid
AND g.acad_org=a.acad_org

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 7 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
ढ्याउ गर्दा दसैँको खसी गनाउच
जाडो, बा र म……
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters