Category "mysql"

SQL query to select row where current date and time is between fields start and end

I have an SQL table containing fields with date and time with columns start and end as DateTime. What I want is a query that will select the row where the curr

How repair corrupt xampp 'mysql.user' table?

I used Xampp yesterday to create some simple Web-based utility tool. Today I wanted to continue working on it but xampp control panel gave me some weir errors.

How to properly use AWS SQS

I was looking for a good way to manage a lot of background tasks, and i found out AWS SQS. My software is coded in PHP. To complete a background task, the wor

MySQL - Connection failed: No route to host

Confused why getting this issue while trying to connect to my DB. Connection failed: No route to host <?php $servername = "HOST"; $username = "USERNAME

Laravel. Json column with cast as array are returning as a string when using JOIN in query

Laravel 8. I have two tables(models) 'employees' and 'positions'. In a model 'employees' I have a casts: protected $casts = [ 'academic_post' => 'array'

JawsDB stuck on "BACKING-UP"

I have a website on Heroku that uses JawsDB MySQL. The app is crashing with "ConnectionRefused." When I try to log into the database directly through MySQL Wo

Use of CONCAT FLOOR Statement

I need to create a frequency table that displays the revenue per bin. The bin has a range of 500. The code shown below almost do the work except it is displayin

MYSQL: Averaging the sum of two columns

Using MYSQL I am trying to get the avg amount spent by all the customers after determining the sum of what each customer spent. select customernumber, round(sum

MariaDB: Unknown data type "MYSQL_JSON"

According to MariaDB's website, you can simply replace MySQL with MariaDB. Great, I thought, however after installing MariaDB (10.5.7), some of my InnoDB tables

MY SQL Sequelize Unique Value not working as intended

I am trying to code a website to work with ReactJS, NodeJs and MySQL. I have been using Sequelize and it works but i realised that it allows all usernames even

Error while importing CSV file in database

I try to import a CSV file in my database, I don't have any error but no rows are insert I checked my field name My table structure is: CREATE TABLE IF NOT E

How to Connect SQL Server to MySQL using Linked Server ODBC Connection

I'm trying to create a linked server from my SQL Server to a MySQL db. No matter what I do, I get the following error: Cannot initialize the data source object

increment via trigger varchar value in the column

please help to solve one problem - I need to create after insert in table row with incremented value id number 1 inc1 2 inc2 I need to insert inc3 in number c

TypeError: require(...) is not a function while Using sequalize with node js

I am beginner in web dev and trying to create a Full stack project using Mysql Express React Node js. Facing this TypeError issue while using Sequalize with nod

How to get mysql result in following format

Database Tables: The below tables contain the information about users and their licenses. Note: One user can have multiple licenses. users table Users( 'user_id

How to find the selected id in my List<String> ids arraylist?

Here is my code. I am trying to use JUnit to test the deleteUsers() method, but everytime I write my test, it deletes all the users that I have in the database.

NodeJS Mysql Query with multiple fields in where clause

I'm working with MySQL for a while and also built an API in NodeJS including mySQL for work Basically i need a query like "SELECT * FROM table WHERE fieldA=varA

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

I know there are tons of question that includes that error, but I haven't seen one that incldues a subquery with row_numbers. Ok so I have this raw query which

How to get records that has relationship with all records in another table in many to many relationships in MySQL?

I am using Laravel 8 and MySQL8. I have these tables: products id - integer name - string factories id - integer name - string factory_product

How to fetch the data from multiple tables order by SUM query?

I have different tables like profiles, tournaments, tournamentdate, tournamentresult and pigeons. Profiles columns > ProfileId, Name, Address, etc. Tournamen