Можем ли мы использовать условие «Между» в сценариях usql при объединении нескольких таблиц.Ниже приведен фрагмент кода:
SELECT sf.ScoringFeedCode AS ScoringFeedCode,
mc.CalendarCode AS CycleCode,
mc.CalendarGUID AS CycleCalendarGUID,
(DateTime.ParseExact(mc.StartDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS CycleStartDate,
(DateTime.ParseExact(mc.EndDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS CycleEndDate,
(DateTime.ParseExact(mc.CalendarStartDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS MonthCalStartDate,
(DateTime.ParseExact(mc.CalendarEndDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS MonthCalEndDate,
qc.CalendarCode AS QtrCode,
qc.CalendarGUID AS QtrCalendarGUID,
(DateTime.ParseExact(qc.StartDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS QtrStartDate,
(DateTime.ParseExact(qc.EndDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS QtrEndDate,
(DateTime.ParseExact(qc.CalendarStartDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS QtrCalStartDate,
(DateTime.ParseExact(qc.CalendarEndDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS QtrCalEndDate,
(DateTime.ParseExact(wc.EndDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS WeekEndDate,
(DateTime.ParseExact(sfc.MaxChangedOnDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS MaxChangedOnDate,
(DateTime.ParseExact(sf.LockDate, @datetimeformat, null)).ToString("yyyy-MM-dd") AS LockDate
FROM @ScoringFeedControlData AS sfc
INNER JOIN
@ScoringFeedData AS sf
ON sfc.ScoringFeedGUID == sf.ScoringFeedGUID
INNER JOIN
@CalendarFileData AS sc
ON sfc.CalendarGUID == sc.CalendarGUID
INNER JOIN
@CalendarFileData AS wc
ON wc.EndDate BETWEEN sc.StartDate AND sc.EndDate
INNER JOIN
@PeriodTypeFileData AS pt
ON pt.PeriodTypeGUID == wc.PeriodTypeGUID
INNER JOIN
@CalendarFileData AS qc
ON wc.EndDate BETWEEN qc.StartDate AND qc.EndDate
INNER JOIN
@PeriodTypeFileData AS qpt
ON qpt.PeriodTypeGUID == qc.PeriodTypeGUID
INNER JOIN
@CalendarFileData AS mc
ON wc.EndDate BETWEEN mc.StartDate AND mc.EndDate
INNER JOIN
@PeriodTypeFileData AS mpt
ON mpt.PeriodTypeGUID == mc.PeriodTypeGUID.
Какие условия не разрешены и не разрешены в условиях соединения в сценариях usql?