select f_calladdr,count(f_calladdr) as i,sum(F_long) as s,name,phone
from Tab_Phone as t,users as u
where u.id=t.f_calladdr
group by f_calladdr,name,phone
刚测试完这样是好使的,但是为什么在后面加个order by sum(F_long) desc就不好使了呢
哪位高手知道啊?帮个忙!
from Tab_Phone as t,users as u
where u.id=t.f_calladdr
group by f_calladdr,name,phone
刚测试完这样是好使的,但是为什么在后面加个order by sum(F_long) desc就不好使了呢
哪位高手知道啊?帮个忙!
select t.f_calladdr,count(f_calladdr) as i,sum(t.F_long) as s,u.name,t.phone
from Tab_Phone as t,users as u
where u.id=t.f_calladdr
group by t.f_calladdr,u.name,t.phone
order by s desc
from Tab_Ph6 as t,users as u
where u.id=t.f_calladdr and year(F_Date)='2007'and month(F_Date)='6' and day(F_Date)='7' and F_Long>120 and UserZu between 1 and 5
group by f_calladdr,name,phone
order by sum(F_long) desc
这条SQL语句哪里有问题啊
from Tab_Ph6 as t,users as u
where u.id=t.f_calladdr and year(t.F_Date)='2007'and month(t.F_Date)='6'
and day(t.F_Date)='7' and t.F_Long>120 and u.UserZu between 1 and 5
group by t.f_calladdr,u.name,u.phone
order by s desc
select * from (
select f_calladdr,count(f_calladdr) as i,sum(F_long) as u,name,phone from tab_phone as t,users as u
where u.id=t.f_calladdr and year(F_Date)='2007'and month(F_Date)='6' and day(F_Date)='7' and F_Long>120 and UserZu between 1 and 5 group by f_calladdr,name,phone
) as tab1
order by tab1.i