Category "mysql"

MySQL is not using composite index with ORDER BY clause

I have a table user that looks like this id | first_name | last_name | org_id This table has few million entries. I want to run the below query with an exact

Update the column in case of duplicate in mysql

So I am storing some config values in my table which looks like name value secret 1223 url "url" Now I have a situation where I want to update the secr

Truncating, Selecting data from multiple tables using joins and then inserting data into separate table in spring boot

I am using a spring boot application. I have multiple tables and using inner joins, I want to populate a temp table. Before populating, I have to truncate the t

Select the ORDER BY ASC|DESC according to a value

I want to select the order by type according to a variable. Something like this: ORDER BY t.name case when @sort = 'asc' then ASC ELSE then DESC END Is that pos

How to handle changed database structures in Liquibase when switching between Git branches

Imagine I have a USER MySql table with the rows id, name, email, address in the 'main' Git branch. I create a new feature branch and decide the 'address' column

Error executing DDL "alter table add constraint foreign key () references (id)" via JDBC Statement

Error executing DDL "alter table child add constraint foreign key (parent_id) references (id)" via JDBC Statement caused by Failed to add the foreign key c

asp.net 6 EF using MySql Database not working

I am trying to connect my Web API build in asp.net 6 with MySql and I am having a lot of trouble My Service looks like this builder.Services.AddDbContext<Tic

PDO MYSQL HY093 (wrong number of parameters) issued incorrectly

I am receiving an HY093 (Parameter count mismatch) SQLSTATE on a query where I don't believe a mismatch exists. Below I have a complete PHP script to reproduce

Calculate sum of partial table with SQL

I have the following table: +-------+------------+ | level | count(uid) | +-------+------------+ | 3 | 1 | | 4 | 1 | | 0 |

command prompt does not allow me to use docker and mysql functions at the same time for creating an sql database in docker container

I start by saying that I am new to the docker and mysql functions for creating containers with a volume. In this case I need to import a .sql file called databa

How to get query data converting foreign table's another column

I'm now using sqlalchemy, fastapi develop some REST API. And facing some problem to join multiple tables I have 2 tables as below [campaigns] class Campaign(Bas

MySQL Operation overhead and dealing with large table

This is my current table DDL. Its a big table 7TB where 6 TB is data and 1TB is index. The number of records in this table is 3 billion. There are currently 10

WP Slow queries / Duplicated queries - images

I have problems with slow and duplicated queries, I'll need assistance, I'm working on this for more than 10h+. Latest WP version - Latest Flatsome theme and ju

My delete function will not work using react frontend but backend are okay its working

I'm new to React. I am working on a react application that communicates with a MYSQL database. When i open the application I get a list of all the students who

Getting error in Export progress while selecting schema for export

I'm trying to export schema but it's giving me an error in Export progress section Error Fetching Table List From CityState (DbMySQLQuery.resultFieldStringValue

Trying to get only cells with certain initials but giving me syntax error? SQL

So my assignment question is to "Get a list of all books withdrawn by people with the initials 'B.W.'. Show a column for the first name, last name, initials, an

Simple spring data jpa transaction to small table on mysql database is hanging indefinitely

I have a spring data jpa query that reads a row from a mysql table with a pessimistic lock. In my environment, this table only contains one row so it should be

What is the difference between Query builder, find and findone in typeorm?

I have used a query in typeorm using query builder as: getManager().CreateQueryBuilder(class_name_from_entity_file, 'xyz').select('column_name').where('active_s

Does querying int column with string datatype have any performance impact in mysql queries?

Assuming I have a table as: create table any_table (any_column_1 int, any_column_2 varchar(255)); create index any_table_any_column_1_IDX USING BTREE ON any_tab

Does querying int column with string datatype have any performance impact in mysql queries?

Assuming I have a table as: create table any_table (any_column_1 int, any_column_2 varchar(255)); create index any_table_any_column_1_IDX USING BTREE ON any_tab