MySql多列查询
SELECT
(
SELECT count(1) from `cti_interchringlen` where TimeLens > 0 and TimeLens<= 4 and `Date`='2012-01-12' and AgentName ='1004' order by count(1) desc
) as '[0-4]',
(
SELECT count(1 ) from `cti_interchringlen` where TimeLens > 4 and TimeLens<= 6 and `Date`='2012-01-12' and AgentName ='1004'
) AS '[4-6]',
(
SELECT count(1) from `cti_interchringlen` WHERE TimeLens > 6 and TimeLens<= 8 and `Date`='2012-01-12' and AgentName ='1004'
)AS '[6-8]'
作者:Elite.net
出处:http://www.cnblogs.com/yhyjy/
新浪微博:http://weibo.com/u/2709913775
世上本无垃圾,所谓垃圾是你放错了地方!
每天积累一点点,那么理想便会距离我们越来越近!
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
出处:http://www.cnblogs.com/yhyjy/
新浪微博:http://weibo.com/u/2709913775
世上本无垃圾,所谓垃圾是你放错了地方!
每天积累一点点,那么理想便会距离我们越来越近!
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。