Groups | Blog | Home
all groups > sql server (microsoft) > june 2006 >

sql server (microsoft) : SELECT statement help


schoultzy
6/26/2006 12:36:19 PM
Hello everyone,

I am working with the following code:

select section_master.trm_cde, section_master.crs_cde, crs_title,
crs_capacity,
crs_enrollment, section_master.udef_3a_1, monday, tuesday, wednesday,
thursday, friday, begin_time, end_time, bldg_cde, room_cde,
name_master.last_name

from section_master left outer join hdx_reg_class_periods on
section_master.udef_3a_1 = hdx_reg_class_periods.period
inner join section_schedules on (section_master.crs_cde =
section_schedules.crs_cde
and section_master.yr_cde = section_schedules.yr_cde and
section_master.trm_cde = section_schedules.trm_cde)
left outer join name_master on section_schedules.professor_id_num =
name_master.id_num

where section_master.yr_cde = '2006'
order by section_master.trm_cde, bldg_cde, room_cde,
section_master.udef_3a_1

Some clarification, section_master.udef_3a_1 holds the class period in
which a given class occurs. This SELECT statement returns all classes
and rooms that are taken (currently being used). I would like to turn
this statement around to get all the classes and rooms that are not
taken (not currently being used). I also have to take into account
those course periods that conflict with other course periods. These
conflicts are listed in a table, hdx_reg_class_period_conflicts, which
contains to columns: one that lists the course period and one that
lists the conflict for that period (there can be multiple conflicts for
a given period). I am hoping that someone out there could help me
accomplish this as I am a novice when it comes to SQL.
Mike C#
6/27/2006 9:04:47 PM
Post your DDL and some sample data and I'm sure any number of people here
would be happy to make short work of this for you.
See http://www.aspfaq.com/etiquette.asp?id=5006 for more information.

[quoted text, click to view]

AddThis Social Bookmark Button