skip to Main Content

Unexpected result in defined function Python – Mysql

I have defined a function: def findbasecoin(Ticker): mycursor.execute(f"SELECT `param_basecoin`.`Symbol` FROM `param_asset` INNER JOIN `param_pair` ON `param_asset`.`id_pair` = `param_pair`.`pair_id` INNER JOIN `param_basecoin` ON `param_pair`.`Coin2_id` = `param_basecoin`.`basecoin_id` WHERE `param_asset`.`Ticker` LIKE '{Ticker.lower()}';") for result in mycursor: result = result[0] When I do print(result),…

VIEW QUESTION

Create MySQL triggers

I need to write a trigger so that it counts the total purchase amount(total_price) in the purchase_data table, that is, multiplies the quantity(product_count) from the purchase_data table by the price of the product(product_price) from the product table. It is necessary…

VIEW QUESTION

MySQL update via join – why is it slow?

I have the following query: UPDATE `temp_table`, `sms` SET `sms`.`to` = `temp_table`.`new_value` WHERE `sms`.`to` = `temp_table`.`old_value`; temp_table has ~200,000 rows. sms has ~2,000,000 rows. sms.to, temp_table.new_value, and temp_table.old_value are VARCHAR(255) with indexes. Values are UK phone numbers. The update query…

VIEW QUESTION

Get primary keys with unicode characters in mysql

I'm trying to write an query that will analyze the data stored in Primary Keys across multiple tables to find if they contain unicode characters in them. Below are the schema of my tables: mysql> SHOW CREATE TABLE employee_plain; +----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+…

VIEW QUESTION
Back To Top
Search