日期:2014-05-18 浏览次数:20545 次
SELECT 序号= (SELECT COUNT(合同号) FROM 订单 AS LiMing WHERE LiMing.合同号<= Chang.合同号) FROM 订单 AS Chang where 合同号='009' ORDER BY 1
--SELECT COUNT(合同号) FROM 订单 AS LiMing WHERE LiMing.合同号<= Chang.合同号 查询小于或等于'009'的合同号记录行!
------解决方案--------------------
SELECT 序号= (SELECT COUNT(合同号) FROM 订单 AS LiMing WHERE LiMing.合同号<= Chang.合同号 where LiMing.合同号='009') FROM 订单 AS Chang where 合同号='009' ORDER BY 1
------解决方案--------------------
SELECT 序号= (SELECT COUNT(合同号) FROM 订单 WHERE 合同号<= Chang.合同号) FROM 订单 AS Chang where 合同号='009' ORDER BY 1
------解决方案--------------------
这序号很蛋疼,还是在应用程序段解决的比较好