Questions tagged [mariadb-10.3]

MariaDB 10.3 is an open source database server that offers similar functionality compared to MySQL.

MariaDB 10.3 is an open source database server that offers similar functionality compared to MySQL. Since version 10.0 MariaDB has veered off MySQL and now implements a different set of features.

MariaDB 10.3 implements system-versioning tables, PERCENTILE_CONT(), PERCENTILE_DISC(), and MEDIAN() window functions, INTERSECT and EXCEPT clauses, cursors with parameters, LIMIT in multi-table updates, LIMIT in GROUP_CONCAT(), and many other new features.

171 questions
2
votes
1 answer

Very basic IF EXISTS statement not working

I really don't understand why my statement: IF EXISTS (SELECT * FROM people WHERE ID = 168) THEN SELECT * FROM people END IF; is returning this error: Unknown statement type. (near "IF EXISTS" at position 0) I'm using MariaDB 10.3. Any…
DevelJoe
  • 856
  • 1
  • 10
  • 24
2
votes
0 answers

MariaDB / Wordpress High CPU Suggestion

I have an old website with 5K posts and 14K photos, website not used for 3 years. Now i want to reactive it. Database is about 250mb. I am using Wordpress. I cleanedup and update everything also the theme. Its now very fast and stable with online…
2
votes
2 answers

Compare values in two tables and calculate the difference of them

DB-Fiddle /* Table Sales */ CREATE TABLE sales ( id int auto_increment primary key, product VARCHAR(255), KPI VARCHAR(255), sales_volume INT ); INSERT INTO sales (product, KPI, sales_volume) VALUES ("Product A", "sold",…
Michi
  • 4,663
  • 6
  • 33
  • 83
2
votes
3 answers

SQL Code works fine on an online compiler but fails when compiled by MariaDB in Linux Terminal (errno: 150)

Searched through the forums, tried a bunch of solutions, but nothing seems to be working. Below is a small snippet of the code and the online compiler I used. I get (errno: 150 "Foreign Key constraint is incorrectly formed"). Do note, this error…
EltoCode
  • 65
  • 4
1
vote
1 answer

MariaDB procedure while loop breaking when looping through more than 1 item

Morning all, Got a question on MariaDB 10.3 stored procedures. I am trying to generate a procedure that can output a table of items, based on logic in the procedure. For a game i am designing, the procedure should output random rewards to the…
1
vote
1 answer

mariadb alternative to outer apply or lateral?

What I wanted was to use CROSS APPLY, but I guess that doesn't exist in mysql. The alternative I've read is LATERAL. Well, I'm using mariadb 10.3 and I guess that doesn't exist either. The ticket table contains an id that's referenced by the…
Phaelax z
  • 1,814
  • 1
  • 7
  • 19
1
vote
1 answer

mysql group by hour - how to avoid wrong results

In this table the values of my rain counter are stored. The correct total is 0.9 In the RAW Data you can see that at 17:01 the value was set to 1161.5. By sql query the RAW data are grouped per hour. In the results only 0.6 rain are shown in the…
Quito96
  • 71
  • 5
1
vote
2 answers

Using MariaDb, how can I query a json(longtext) column to check if a given value exists under any key?

I have this json data in a 'name' column, where the names of some records are stored with multi-lang support: {"en":"Professional Association","de":"Berufsverband","uk":null} When I run this query returns 0 records: select * from `some_table` where…
1
vote
1 answer

Dynamically convert rows to columns in MariaDB 10.3

I have the following table…
dimoss
  • 479
  • 1
  • 3
  • 10
1
vote
0 answers

How to fix the 'Can't load'-error when a perl script is executing 'use DBD::mysql;'

For years, I'm running a perl script on my Synology NAS. This script writes to a MariaDB database. I never had any errors. Until the migration to DSM7. This is what happened ... I never had any problem when using MariaDB5 I migrated my database…
1
vote
3 answers

Get last rows where value is 0

I have a table pesajes where the weigh-ins of the competitors are stored pesajes: id championship competitor accepted time 1 18 1280 0 1370931202 2 18 1280 1 1370931784 3 …
Nebur81
  • 29
  • 1
  • 9
1
vote
0 answers

"SQL Error (1292): Truncated incorrect DOUBLE value: 'unknown'" upon INSERT but not when only SELECTing

Can someone please help me understand why below INSERT query INSERT INTO ha_archive.pond(last_updated, water) SELECT DATE(s.last_updated) 'last_updated', SUM(s.state) 'water' FROM home_assistant.states s WHERE s.entity_id =…
Joost
  • 82
  • 1
  • 9
1
vote
1 answer

Exclude the user on the count if the post is created by the same user

I have the following scenario in my system: a member: CREATE TABLE `member` ( `memberid` int(11) NOT NULL, `email` text ); creates the protocols: CREATE TABLE `protocol` ( `protocolid` int(11) NOT NULL, `createdby` int(11) NOT NULL, …
Rasik
  • 1,961
  • 3
  • 35
  • 72
1
vote
1 answer

Mariadb 10.3.29 BEGIN... END statement not working with DECLARE

i am having an issue getting the following statement to run in Mariadb 10.3.29 and 10.3.13 delimiter | BEGIN NOT ATOMIC DECLARE finished int default 0; DECLARE query varchar(500) default ""; DECLARE curQuery CURSOR FOR …
Jeff
  • 21
  • 1
  • 7
1
vote
1 answer

How to add MariaDB JSON Constraint

I'm trying to add a JSON_VALID constraint to a column in a table on MariaDB v10.3.27 - and keeps giving me errors. I tried the code I found in MariaDB documentation: ALTER TABLE table_name CONSTRAINT CHECK(JSON_VALID(column_name)); returning the…
1
2
3
11 12