日期:2014-05-16 浏览次数:20705 次
IF OBJECT_ID('TEMPDB.DBO.#tb') IS NOT NULL DROP TABLE #tb
GO
CREATE TABLE #tb
(
userid VARCHAR(4),
trading DATETIME,
)
insert into #tb
values('0001','2012-12-01 10:10:01'),
('0001','2012-12-02 09:21:10'),
('0001','2012-12-03 11:10:13'),
('0001','2012-12-04 14:12:51'),
('0001','2012-12-05 17:22:10'),
('0001','2012-12-06 14:14:00'),
('0001','2013-01-01 07:10:01'),
('0001','2013-01-02 11:13:55'),
('0001','2013-01-10 18:25:00'),
('0002','2014-01-01 18:09:00'),
('0002','2014-01-02 19:19:12'),
('0002','2014-01-03 10:18:33'),
('0002','2014-02-03 11:22:00'),
('0002','2014-02-04 10:18:10'),
('0002','2014-02-07 16:19:30'),
('0002','2014-03-05 08:22:00'),
('0002','2014-03-06 19:33:30')
IF OBJECT_ID('TEMPDB.DBO.#tc') IS NOT NULL DROP TABLE #tc
GO
CREATE TABLE #tc
(
userid VARCHAR(4),
trading DATE,
)
insert into #tc
values('0001','2012-12-06'),
('0002','2014-01-03'),
('0002','2014-02-07'),
('0002','2014-03-06')
IF OBJECT_ID('TEMPDB.DBO.#tb') IS NOT NULL DROP TABLE #tb
GO