Category "mysql"

How to handle data in development, staging and production databases?

If you have a local database, Staging/UAT database, Production database 1)Say 10 developers have the database script to generate the database (I'm using liquiba

How to get the last transaction of each player - SQL Solution

I have a database where I store all transactions made in a game (picture of DB). Now I want to get the value of the last transaction for each player. I already

How to replace a specific value in a MySQL row if the word is exist?

How can I replace a specific value in MySQL if it's exist? I have a servers table in that table I have an opts row the row's value is: +set net_port 28112 +set

MySQL Unknown column in CHECK

I have a MySQL database And I want to add a column: MariaDB [(none)]> use myDatabase; Database changed MariaDB [myDatabase]> ALTER TABLE material add new

Why am I getting this MySQL error with node?

I have connected to the database on MySQL, and was able to input data to a table. However, I am not able to input data to another table when it seems that I'm u

Why am I getting this MySQL error with node?

I have connected to the database on MySQL, and was able to input data to a table. However, I am not able to input data to another table when it seems that I'm u

How can I store data from JS into a MySQL database

First things first, I'm new to the forum, anything I write that isn't concise or just flatt out adjective let me know! I'm developing an app that can retrieve d

SQL Moving window over two level of groupby

I have the following table of orders for users like the following: CREATE TABLE orders ( order_id UUID, user_id UUID, date date,

Displayed values are not what they should be

There are 2 tables ost_ticket and ost_ticket_action_history. create table ost_ticket( ticket_id int not null PRIMARY KEY, created timestamp, staff bool, statu

MySQL 8.0.27 not accepting django check constraints

I have seen a 2 years old similar question to this but the question did not specify the MySQL version and there is no answers to the question. I'm use the djang

knex migration - 'ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I have a knex chema migration to create a table, with the line - exports.up = async function(knex) { return knex.schema.createTable("newTable", table => { ta

knex migration - 'ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I have a knex chema migration to create a table, with the line - exports.up = async function(knex) { return knex.schema.createTable("newTable", table => { ta

no such file libmariadb.3.dylib error when importing MySQLdb on mac M1

I migrated my data to M1 Monterey MacOS from intel macmini. I was happy to use django and mariadb until I installed a package using homebrew. I installed homebr

MySQL dynamically find available reservations

I have a requirement to create a room reservation system with dynamic booking slots (a reservation can start at any time and last anywhere from 15 minutes up to

Changing a variable initialized in the outer scope after fetching using mysql

I'm trying to make a history page where users can see the videos they recently uploaded or downloaded. I'm writing it in NextJS. I'm using Mysql to store the da

Foreign key 'FK_NhanVien.....' references invalid table 'PhongBan". Why invalid?

Foreign key 'FK_NhanVien.....' references invalid table 'PhongBan". Why is it invalid? create table NhanVien( MaNV varchar(9) not null primary key foreign k

Check if value exists on one date missing on next

I have one table with below column Table I want to find missing nodes Missing node definition: node present on day and missing the next day will be missing node

CodeIgniter 4 Inner Join in Codeigniter

Just want to ask if how can I use the INNER JOIN function on CodeIgniter 4? I'm trying to convert the SQL statement below to CodeIgniter 4 but since I'm just ne

MySQL Get same yesterday day of previous week data

Let say yesterday was Wednesday; I need to get all records for Wednesday of previous week. How to achieve this in MySQL statement condition?

How to use foreign keys migration with database migrations. (errno: 150 "Foreign key constraint is incorrectly formed")?

CodeIgniter 4 has a handy solution for migrations and seeders. Without the usage of foreign keys, everything is working perfectly. But when I use foreign keys I