![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Помогите с запросиком а [D6, MSSQL]
GAlex © (2003-04-08 13:41:00)select top 10 cast(convert(char,call_time,104) as datetime),sum(money)
from dbo.user_log
group by cast(convert(char,call_time,104) as datetime)
order by cast(convert(char,call_time,104) as datetime)
Работает, а
select top 10 cast(convert(char,call_time,104) as datetime) as ddd,sum(money)
from dbo.user_log
group by ddd
order by ddd
Не хочет =(
ЮЮ (2003-04-08 14:54:00) [1]select ddd, sum(money)
from
(select top 10
cast(convert(char,call_time,104) as datetime) as ddd,
money
from dbo.user_log) a
group by ddd
order by ddd
GAlex (2003-04-08 14:42:00) [2]2 chdv так не хочет работать =(
Johnmen (2003-04-08 14:00:00) [3]Использование алиасов полей недопустимо при обращении к ним...
chdv (2003-04-08 13:53:00) [4]и не будет.
попробуй так
select ddd, sum(money)
from
(select top 10
cast(convert(char,call_time,104) as datetime) as ddd,
money
from dbo.user_log)
group by ddd
order by ddd