--------------------------------------------------------------------------------
-- 이하는 `eod_log` 데이터베이스에서 수행
--------------------------------------------------------------------------------

-- 강화 컨텐츠 이용 횟수
SELECT
    `user_id`,
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_item`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`general_type_code` = 150000101) AND
      (`consume_route` = 19)
GROUP BY `character_id`
ORDER BY `user_id`;


-- 합성 컨텐츠 이용 횟수
SELECT
    `user_id`,
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_equipment`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`consume_route` = 20)
GROUP BY `character_id`
ORDER BY `user_id`;


-- 승급 컨텐츠 이용 횟수
SELECT
    `character_id`,
    COUNT(1) AS `operation_count`
FROM `eod_log`.`table_item`
WHERE (`log_time` BETWEEN '2017-07-19 00:00:00' AND '2017-07-25 23:59:59') AND
      (`general_type_code` IN (160000601, 160000602, 160000603)) AND
      (`consume_route` = 21)
GROUP BY `character_id`
ORDER BY `character_id`;



--------------------------------------------------------------------------------
-- 위에서 얻은 캐릭터 목록으로 플레이어의 닉네임을 `eod_game`에서 찾는다.
--------------------------------------------------------------------------------

-- 플레이어 캐릭터 번호로 계정 찾기
SELECT `nickname` FROM `eod_game`.`table_player`
WHERE (`user_id` IN
          (
              SELECT `owner_user_id`
              FROM `eod_game`.`table_player_character`
              WHERE (`character_id` IN (/* 여기에 찾을 캐릭터 ID들을 전부 집어넣을 것*/))
          )
      );

