Anti Gold Dupe
#11


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.



Messages In This Thread
[No subject] - by Stormax - 01-21-2023, 10:24 AM
[No subject] - by Veni - 01-21-2023, 11:41 AM
[No subject] - by Stormax - 01-21-2023, 01:27 PM
[No subject] - by rondo157 - 01-21-2023, 02:34 PM
[No subject] - by Desarija - 01-23-2023, 11:51 AM
[No subject] - by dethunter12 - 02-10-2024, 09:12 PM
[No subject] - by Scura - 02-18-2024, 09:46 AM
[No subject] - by dethunter12 - 02-18-2024, 05:08 PM
[No subject] - by dethunter12 - 02-18-2024, 05:50 PM
[No subject] - by Scura - 03-01-2024, 04:53 PM
[No subject] - by dethunter12 - 03-01-2024, 07:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)