
mysql> select sum(p.price*i.count) from items i left join prices p on (i.item_id = p.item_id) left join characters c on (i.owner_id = c.obj_Id) where c.accesslevel<30 and c.obj_Id is not null;
+----------------------+
| sum(p.price*i.count) |
+----------------------+
| 16521888785 |
+----------------------+
1 row in set (1.50 sec)

mysql> select sum(p.price*i.count) from items i left join prices p on (i.item_id = p.item_id) left join characters c on (i.owner_id = c.obj_Id) where c.accesslevel<30 and c.accesslevel >= 0 and c.obj_Id is not null;
+----------------------+
| sum(p.price*i.count) |
+----------------------+
| 3548551172 |
+----------------------+
1 row in set (1.49 sec)
Balancer:Пардон, забаненных не вычел
mysql> select sum(p.price*i.count) from items i left join prices p on (i.item_id = p.item_id) left join characters c on (i.owner_id = c.obj_Id) where c.accesslevel<30 and c.accesslevel >= 0 and c.obj_Id is not null; +----------------------+ | sum(p.price*i.count) | +----------------------+ | 3548551172 | +----------------------+ 1 row in set (1.49 sec)
3 кланхолла - да, придётся цены сбрасывать
Marry:Балл а как насчет осады?:)
Но в любом случае - вот-вот. Другое дело, что нормальная осада - это сотня человек минимум 
Abaddon:Хм... Насчет этого sql-запроса...
select sum(p.price*i.count) from items i left join prices p on (i.item_id = p.item_id) left join characters c on (i.owner_id = c.obj_Id) where c.obj_Id is not null;
Я так понимаю он возвращает суммарную стоимость всех вещей на сервере? А как чтобы он etcitems не учитывал? Хочу на сайт в статистику прикрутить
Её создание нынче в датапаке есть в каком-то из .sql, я не так давно выложил.