这是我的查询sql server
,
SELECT dbo.tbScheduleDetail.CareProfessionalIDF,
dbo.tbScheduleDetail.CareProviderIDF,
dbo.tbCareProvider.CareProviderName,
dbo.tbCitizen.FirstName + ' ' + dbo.tbCitizen.MiddleName + ' ' + dbo.tbCitizen.FamilyName AS CareProfessionalName,
dbo.tbScheduleTimeSlot.ScheeduleWeekDays,
dbo.tbScheduleTimeSlot.ScheduleStartTime, dbo.tbScheduleTimeSlot.ScheduleEndTime,
dbo.tbScheduleDetail.ScheduleStartDate, dbo.tbScheduleDetail.ScheduleEndDate
FROM dbo.tbScheduleTimeSlot INNER JOIN
dbo.tbScheduleDetail ON dbo.tbScheduleTimeSlot.ScheduleDetailIDF = dbo.tbScheduleDetail.ScheduleDetailIDP INNER JOIN
dbo.tbCareProvider ON dbo.tbScheduleDetail.CareProviderIDF = dbo.tbCareProvider.CareProviderIDP INNER JOIN
dbo.tbCareProfessional ON dbo.tbScheduleDetail.CareProfessionalIDF = dbo.tbCareProfessional.CareProfessionalIDP INNER JOIN
dbo.tbCitizen ON dbo.tbCareProfessional.CitizenIDF = dbo.tbCitizen.CitizenIDP
WHERE (dbo.tbScheduleDetail.IsActive = 1) and CareProviderIDF=4 order by CareProfessionalIDF
输出 :
最后我想像
所以我将 scheduleweekdays 拆分为“,”而不是我得到真实的地方,对于那个索引,我想将 strtime 和 endtime 存储在day[index]
在这里我只取其中一个组合(CareProfessionalIDF=11)我得到了 4 行和存储时间
====================================
StartTime TO EndTime
====================================
day[0] = 00:00TO22:00
day[1] = 00:00TO22:00
day[2] = 04:15TO19:15
day[3] = 04:00TO20:00
day[4] = 08:00TO15:00
day[5] = ""
day[6] = ""
那么我如何为所有组合存储这样的数据。对于data structure
我必须使用的那个?