日期:2014-05-17 浏览次数:20457 次
SELECT (SELECT ParentID
FROM stable
WHERE (cpid = a.cpid)) AS ParentID, cpid, CONVERT(varchar(10), doTime, 120) AS rq,
(SELECT TOP (1) doTime
FROM t_table
WHERE (cpid = a.cpid) AND (CONVERT(varchar(10), doTime, 120) = CONVERT(varchar(10), a.doTime, 120)) AND (CONVERT(varchar(8), doTime, 24)
BETWEEN '00:00:00' AND '03:59:59')
ORDER BY dtp) AS T0_4,
(SELECT TOP (1) doTime
FROM t_table AS t_table_5
WHERE (cpid = a.cpid) AND (CONVERT(varchar(10), doTime, 120) = CONVERT(varchar(10), a.doTime, 120)) AND (CONVERT(varchar(8), doTime, 24)
BETWEEN '04:00:00' AND '07:59:59')
ORDER BY dtp) AS T4_8,
(SELECT TOP (1) doTime