Skip to content
Advertisement

Tag: mariadb

Create view with one row for each column in a table

I have a table that looks like this: I need a view with 3 columns, that has a row for each column in the original table, so it would look like this: The values on the currency column in the view need to be created by me (the EUR, JPY, etc) and are fixed values; I need to get the

How to list 3 largest numbers from table in SQL?

I’m trying to unite two bits of SQL codes and list three largest numbers from it. Here is table relation diagram Query #1: Query #2: My final code shows the full list of all first and second names, simply adding largest number to all of them from orders table. How can I modify it to make it show three names

How to insert an array value to an existing JSON document?

Given a column containing a JSON document, I can use JSON_SET() to set a key in the JSON document to a value. Supported values are null, true, false, numbers and strings; but I can’t figure out how to set an array. The example in the documentation (for JSON_INSERT(), but it works the same) weirdly shows how a naive user might

join tables from different databases only adding most recent date SQL

I am joining lots of data to handle dynamic/complex querying. The following is just a part of what I’m doing. I found a solution, then I think I tweaked it and lost it. Database Structure: oauth.users order.orders ( I know bad naming, I didn’t create the database) (customer_id = user.id) I want to join only the most recent date This

As a result of the Euclidean distance many images are mistakenly identified as identical

Sorry for my bad english, i have a small database that contains hashes of photos, when I try to find similar photos to the one below: for which the following hash was calculated: “0f3f2764ecc482c2” using the method average_hash() The system finds a very large number of collisions, below is an example of photos that were identified as completely identical: The

MariaDB, How to copy existing records using insert?

I have a lot of existing records which I want to copy using an INSERT, for example if I have a query: The common key is biDataset, the primary key in this table is biPK which is auto incremented on each insert. Here is the table structure: What I want to do is copy all the records that exist where

SQL MAX() function seems to truncate results

I have the following basic 3 Table Structure in mariadb/mysql. This simple SELECT returns incomplete records. I reduced the output of all follwing examples to a single dataset to avoid unnecessary clutter. The IP_LONG column is missing the follwing for example… My guess is, it has something to do with the MAX() Function has troubles with mixed Content in the

Advertisement