I have currently these tables. Server: MariaDB (I removed some columns to make it more simple) Person table: id | username | password ——————————————-…
Tag: mariadb
MySQL FullText in Boolean mode: searching keywords that contain ‘+’ as part of the string
I have looked at dozen ‘similar’ questions, without luck. I understand that + attached to a keyword in FULLTEXT in BOOLEAN mode has a special meaning, however, what if our keyword(s) actually contain +…
MariaDB loop not displaying results of query
I have a simple query: SELECT COUNT(ud.UserID), COUNT(DISTINCT ud.ProductID) FROM users_data AS ud JOIN products AS t ON t.ID = ud.ProductID WHERE ud.UserID = ‘3’ Which results in: COUNT(ud….
Ranking based on two columns
Finding the Rank of the Particular User from the Database by comparing three columns. Name | Score | Attempts | Time test | 2 | 4 | 2019-01-29 19:50:11 tes2 | 2 | 1 | 2019-01-…
Error 1064 when using SQL with INSERT INTO … SELECT … ON DUPLICATE KEY UPDATE
I am trying to use ‘INSERT INTO … SELECT ON DUPLICATE KEY UPDATE feature’ but I’m in trouble now. I want to insert data to ‘fruitProperty’ table. My query is as below: START TRANSACTION; SET @…
Slow sql statement when using variables
I have the following SQL statement running against a MariaDB 10.1.26 with ~2.000 rows with instant results. When I use the following statement with variables for the datetime fields, the execution takes ~5.5 seconds. The more data rows I have, the longer it takes to execute the statement. Seems like the variables change the behaviour of the statement somehow. What’s
MySQL – Select where first character is lowercase or uppercase
Sorry if this is something that was asked before, but I am not able to find the answer to this. How do I create a MySQL select statement to select all strings from the database whose first characters …
Select query where exists intersection of two list
I have one table that contains two columns: id (integer) list_colum (longtext) – contains json array (e.g. [1, 2, 3]) I want to select all records that have an intersection of my input list. Let me explain: My input is a list – [2, 3] Pseudo code: Is it possible to do this in SQL? I am using the newest
How to delete a record from database where all fields are the same to another?
I have two only records in a database table and I want to delete only one of them. The problem is that I don’t have any primary key nor unique identifier, so how could I delete one and only one record? It seems a easy question but I didn’t find out how to do it ¿?. Answer This addresses the
What does VARBINARY(MAX) mean?
I’m trying to port a MSSQL database over to MariaDB and I’ve encountered a table creation using varbinary(max): What would this actually do and is there an equivalent type definition in MariaDB that I could use? Answer As others have stated in the comments, VARBINARY(max) in MSSQL refers to: Variable-length binary data. max indicates that the maximum storage size is