657,246 questions
Score of -2
1 answer
65 views
Running MySQL get results and exit
I want to run MySQL to test the connection from my C++ code so if I get a connection the process should just exit.
Is there an option to do that? Or it will detect it automatically?
I'll be running it ...
Score of -3
1 answer
128 views
Why does MySQL allow only one AUTO_INCREMENT Column per table?
I'm learning MySQL, and I understand that a table can have only one AUTO_INCREMENT column.
Most explanations say this is simply a "MySQL design rule," but I'm trying to understand the actual ...
Score of -2
0 answers
86 views
Query has Error 1054 Unknown column 'temp.category_id' in on clause [closed]
The first query is copy pasted from someone and works fine as expected. The column 'temp.category_id' in the on clause coming from the subquery 'temp' is recognized correctly and 1000 rows are ...
Score of 1
2 answers
134 views
Selecting non blank data in aggregation query
I have a table with some order data in it: A simplified summary is like this:
OrderNum
Revenue
Payment
RecordType
OrderData
1
30
0
Order
Shirt-Size:Large
1
0
30
Payment
2
20
0
OrderAmended
T-Shirt:...
Score of 2
1 answer
113 views
Chance of conflicts using stateful classes
TL;DR: is it a bad practice to use a stateful JS class?
I am building a website using Node.js and Express, using MySQL as my DB.
To use the DB I have made a simple CRUD MySQL ORM to retrieve and save ...
Score of -1
1 answer
143 views
Insert record with foreign key if primary key is missing or not?
I have two tables with a primary-foreign key relationship.
A value in the foreign key table must be present in the primary key table.
What is a stored procedure to insert a record into the foreign key ...
Score of -3
0 answers
121 views
File access for LOAD DATA LOCAL INFILE [closed]
I have a module that reads a server log and populates a mysql table with this
$sql="LOAD DATA LOCAL INFILE '/var/log/apache2/access.log' …
By itself it fails, saying that the file can't ...
Score of -1
1 answer
170 views
Is replaying a transactional outbox in auto-increment ID order will maintain the order of events?
I'm implementing a transactional outbox pattern and trying to replay events in order.
After outbox events are published, they are stored in an inbox table on the destination. A separate process ...
Score of -1
2 answers
142 views
Sakila customer who has paid the most using subquery max of all the sums [closed]
I found a query: SELECT name from table WHERE scalar subquery is true
where the user wants a single customer name who has paid the most.
I am trying to understand and rebuild the first solution posted ...
Score of 2
1 answer
81 views
LOAD XML SET field name with minus
Taking the example:
<?xml version="1.0"?>
<employee person_id="1" f-name="Kapek"></employee>
<employee person_id="2" f-name="Sajon&...
Score of 0
1 answer
191 views
Error Code 1054 unknown column in 'field list' error without Group Concat Actor [closed]
I am playing around with the Sakila database. There is a view in this database named film list.
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `sakila`.`film_list` AS
...
Score of -1
0 answers
110 views
Is a hand-rolled CASE expression a reasonable way to do relevance-ranked search with JPA Criteria API + MySQL, or is there a better approach?
I'm building a company search endpoint in a Spring Boot app (JPA Criteria API, MySQL) where I want exact matches to appear before prefix matches and before substring matches when a user searches by ...
Score of 3
1 answer
159 views
Find identical aggregated combinations from pivot table in SQL
Background
I’m updating a very old website which has a tagging feature for objects. The tags are divided into nine separate semantic categories and can be related to objects via a pivot table. There ...
Score of 0
0 answers
165 views
How to design a zero-downtime schema migration strategy for a high-traffic Laravel/MySQL application with hundred of millions rows?
I am designing a Laravel application that handles millions of daily requests with a MySQL database containing tables with hundreds of millions of rows.
A common requirement is adding or modifying ...
Advice
0
votes
6
replies
202
views
Concat multiple row values into for a single empId
Like I have user Data 50 emp inside each user has different skills 3 rows same user but skill column value is different
I want to concat the skill and display in single row for each user don't want ...