注册 登录
编程论坛 SQL Server论坛

求助:课表问题

yunj1105 发布于 2007-04-12 15:52, 610 次点击
怎样实现这样的课表啊?
1--2 3--4 5--7 8--10
星期一
星期二
星期三
星期四
星期五
星期六
星期日
我的数据库是这样的
Cou_ID int not null
Cou_name varchar not null
Cou_week(开课周) char not null
Cou_date(课表里的星期一,二....) char not null
Cou_time(课表里的1--2,3--4...) char not null

[此贴子已经被作者于2007-4-17 12:36:31编辑过]

3 回复
#2
yunj11052007-04-17 14:28
大家来看看怎么解决啊
#3
Kendy1234562007-04-17 15:45
数据库设计的不好

Cou_ID int not null
Cou_name varchar not null
Cou_week char not null
Cou_date char not null
courses12 char not null
courses34 char not null
courses56 char not null
courses78 char not null

这样直接select就出来了

Select Cou_date,Course12,Course34,course56,course78 from Course
where COu_Id = xxx and ....(放你的查询条件)
order by case Cou_date when '星期一' then 1
when '星期二' then 2
when '星期三' then 3
when '星期四' then 4
when '星期五' then 5
when '星期六' then 6
when '星期日' then 7
end
#4
yunj11052007-04-17 16:04
呵呵,就照你说的做了,谢谢
1