Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Go ahead and force read uncommited so we do not lock player tables while users are playing...
- SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
- SELECT * FROM (
- SELECT
- ACCOUNT_ID
- , ACC.NAME AS ACCOUNT_LOGIN
- , CHARACTER_ID
- , CHARACTER_NAME
- ,
- PLAYER_PLATINUM + BANK_PLATINUM + CURSOR_PLATINUM
- + (PLAYER_GOLD + BANK_GOLD + CURSOR_GOLD) / 10
- + (PLAYER_SILVER + BANK_SILVER + CURSOR_SILVER) / 100
- + (PLAYER_COPPER + BANK_COPPER + CURSOR_COPPER) / 1000 AS CHARACTER_NET_WORTH_IN_PLAT
- FROM
- (
- SELECT
- CD.ID AS CHARACTER_ID
- ,CD.NAME AS CHARACTER_NAME
- ,CD.ACCOUNT_ID
- /* Player Platinum! */
- ,CC.platinum AS PLAYER_PLATINUM
- ,CC.gold AS PLAYER_GOLD
- ,CC.silver AS PLAYER_SILVER
- ,CC.copper AS PLAYER_COPPER
- /* Bank Platinum */
- ,CC.platinum_bank AS BANK_PLATINUM
- ,CC.gold_bank AS BANK_GOLD
- ,CC.silver_bank AS BANK_SILVER
- ,CC.copper_bank AS BANK_COPPER
- /* Cursor Platinum */
- ,CC.platinum_cursor AS CURSOR_PLATINUM
- ,CC.gold_cursor AS CURSOR_GOLD
- ,CC.silver_cursor AS CURSOR_SILVER
- ,CC.copper_cursor AS CURSOR_COPPER
- FROM character_data CD
- INNER JOIN character_currency CC ON CC.id = CD.id
- ) IndividualCharacterSlots
- INNER JOIN ACCOUNT ACC
- ON ACC.ID = IndividualCharacterSlots.ACCOUNT_ID
- ) Details
- ORDER BY CHARACTER_NET_WORTH_IN_PLAT DESC
- LIMIT 100;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement