PYTHON – Dynamically update multiple columns using a custom MariaDB connector

While reading this question: SQL Multiple Updates vs single Update performance I was wondering how could I dynamically implement an update for several variables at the same time using a connector like …

MariaDB using ‘distinct’ keyword changes expected behavior of other column

Why does this work: SET @cnt = 0; SELECT (@cnt:=@cnt+1) AS ‘foo’, title FROM employee; But when I add ‘distinct’ keyword, it does not, while distinct works on its own (not shown). SET @cnt = 0; …

i cant view all data when i using Datepicker on ‘WHERE’

hy, please help me,, i cant view all data from emp0003 to checking all employee absence.. emp0003 table NIK Name 01190301 Susan 01190302 Jamed dvc0004 table’s NIK Enroll 01190301 2021-02-03 08:…

Recursive query in tree MySQL8 / MariaDB10

I have a tree-like structure for categories on my database: create table cat( id int auto_increment primary key, url varchar(50), parent int references cat(id) ) How can i build the …

SQL, operation between paired rows

I have a table t1 a b 1 4 2 2 3 9 2 1 1 6 3 7 I need the output a result 1 4*6 2 2*1 3 9*7 I have been able to do it in a far from efficient way and would like a more …

MySQL: Select penult values

There are 2 tables: table1: id |phone| order| —|—–|——| 1 | 122 | 6 | 2 | 122 | 4 | 3 | 122 | 3 | 4 | 123 | 6 | 5 | 123 | 5 | 6 | 123 | 3 | 7 | 124 | 6 |…

how to validate date null in mysql?

I’m working with MariaDB. when I try to show some result don’t show me nothing. select if(fecha is null,’hello’,’bye’) dat from table I’m trying to show me some result, but I don’t know how?…

SQL order by a function with literal values

I want to order some SQL result using the result of a calculation. I can select this SELECT sqrt( POWER(TERM_0 – -0.12985125184059143,2)) from faces f limit 3 So the syntax seems correct, but when I …

Mysql IF statement Error on Nested if sentence

I am trying to create a procedure to update the stopTime field on my works table. The query I am using is: update mydb.works set stopTime= (IF((SELECT table_name FROM information_schema.tables …

MariaDB SUM returns wrong value on column type float

version: 5.5.53-MariaDB I added this table to my MariaDB: CREATE TABLE `myTable` ( `key` int(10) unsigned NOT NULL, `val_float` float unsigned NOT NULL, `val_bigint` bigint(20) unsigned NOT …