![]() |
|
Anti Gold Dupe - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Release Zone (https://lckb.dev/forum/forumdisplay.php?fid=190) +---- Forum: Episode 4 Releases (https://lckb.dev/forum/forumdisplay.php?fid=156) +----- Forum: Server Side (https://lckb.dev/forum/forumdisplay.php?fid=138) +----- Thread: Anti Gold Dupe (/showthread.php?tid=5009) Pages:
1
2
|
- dethunter12 - 03-01-2024 2 hours ago, Scura said: Nice! I wanna point out just a simple consideration: Remember that you can directly create a table with a select, wich means you don't have to perform 2 different mysql commands: CREATE TABLE IF NOT EXISTS `t_gold_results` AS ( SELECT x, y FROM k LEFT JOIN ...); In this case you can call it as (where MaxGold is an sql variable or bash var): CREATE TABLE IF NOT EXISTS `t_gold_results` AS ( SELECT a_user_index, a_nick, a_nas, 'Character' AS a_gold_type FROM t_characters WHERE a_nas > $MaxGold UNION SELECT t_stash_money.a_user_index, t_characters.a_nick, t_stash_money.a_stash_money, 'Stash' AS a_gold_type FROM t_stash_money INNER JOIN t_characters ON t_characters.a_user_index = t_stash_money.a_user_index WHERE t_stash_money.a_stash_money > $MaxGold; ) i wasn't aware thank you. |