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]'

posted @   Elite_Y  阅读(2741)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示