我正在使用 SQL Server 2012,并且正在尝试执行以下操作:
SELECT SUM(MILES) from tblName WHERE
mDate > = '03/01/2012' and
mDate <= '03/31/2012'
-- and...
/*
now I want to add here do until the SUM of Miles
is equal to or greater then '3250' and get the
results rows randomly
*/
所以换句话说,我想从一个表中选择具有指定从和到日期的随机行,并在里程总和等于或超过该数字时停止:3250