657,986 questions
-5
votes
0
answers
75
views
Real DISTINCT impossible? [closed]
I have a table called ‘Employees’ with the following structure:
employee_id
employee_name
store_id
1000
Mark
1
1000
Mark
2
1001
Susan
3
1002
Ben
4
1003
Vic
5
As you can see, Mark works in two stores.
...
0
votes
0
answers
37
views
Transpose a table and concatenate value into single var [duplicate]
NAME
Instance
Date
val
John
1
2019
12Y
John
2
2019
32dd
John
3
2019
23F
John
1
2020
43s
John
1
2022
23G
Mary
...
...
...
How do I convert the table into below?
Basically transpose by NAME and DATE and ...
Best practices
0
votes
4
replies
76
views
How to manage data state between MySQL and Clickhouse?
I have MySQL and Clickhouse running for my system. Here MySQL is the source of truth and I store analytical data such as metrics (count, avg etc..) in Clickhouse. I have aggregated tables in ...
Tooling
0
votes
22
replies
150
views
Which services are typically required to scale a LAMP stack for high-traffic production environments?
I am designing a LAMP-based application (Linux, Apache, MySQL, PHP) expected to handle increasing concurrent traffic (e.g., thousands of requests per minute).
From research and feedback, it seems that ...
Advice
0
votes
6
replies
87
views
Multi Vendor Insurance system best db design
I am building a module in which I have to integrate multi-vendor insurance using the nestjs and mysql. Mainly our purpose is to do insurance for new E-rickshaws. So, what is the best tables schemas I ...
1
vote
2
answers
127
views
SQL Sum on the most recent previous valuer
I am trying to find the running sum of quantities across accounts over time. Ideally I want to sum the quantities of the current row and the most recent row for each account.
Given the following as ...
-2
votes
0
answers
25
views
Deleted user Name root for local site. Common solutions haven't worked. ERROR 1045 (28000): Access denied for user 'root'@'localhost' [migrated]
Sorry if this is a silly question.
I'm running a local Wordpress website through WP engine with a MySQL database through AdminNEO on my browser and made a terrible mistake of deleting "root" ...
Advice
0
votes
6
replies
102
views
MySQL set the default unix time
Earlier, I set the time field, int type, to the default time value in unix format.
When adding an entry, the time field accepts the time since 1970 in unix format.
I'm trying to do the same with the ...
-1
votes
0
answers
101
views
How do I get a trigger to only delete an associated row in another table in SQL?
I currently have 3 tables:
CREATE TABLE IF NOT EXISTS customers(
ID int unsigned NOT NULL AUTO_INCREMENT primary key,
first_name varchar(50),
last_name varchar(50),
email_address ...
-11
votes
0
answers
132
views
Does parser_name stored somewhere in information_schema in MySQL
Or this index parameter is "fire and forget" one?
If I create a table in MySQL and then assign the FULLTEXT index to it its possible to assign a parser to such index.
One can use WITH PARSER ...
0
votes
0
answers
129
views
SQL JOIN returning duplicate rows instead of expected results [duplicate]
I am trying to combine data from two tables using a JOIN, but I am getting duplicate rows in the result instead of the expected output.
Here are my tables:
Customers
CustomerID
CustomerName
Orders
...
-2
votes
2
answers
112
views
Row inserted without error, but not showing up in the table [closed]
I added this row and MySQL showed
1 row(s) affected
But even when I counted the rows before and after inserting the row, the count is the same. I believe it means the row was not inserted. Then why ...
0
votes
1
answer
86
views
Exceeded max user connections in python / flask / mysql
I am trying to run a Python / Flask / MySQL app but whenever I try to run it (using the command "python -m flask run"), it gives me this error:
mysql.connector.errors.ProgrammingError: 1226 ...
0
votes
1
answer
83
views
Adding a column to an SQL query based on join
I would like to left join multiple tables, and in the output have a column that is basically dependent on which table the join came from. So for example, if I have a single join:
SELECT B.Name, A....
-2
votes
3
answers
65
views
Updating BINARY LOWER/UPPER queries to CAST
I'm using this query to identify misstyped usernames:
SELECT * FROM import_bk
WHERE
(
bk_name = BINARY LOWER(bk_name) OR
bk_name = BINARY UPPER(bk_name) OR
bk_name REGEXP '[0-9]'
)
But I always get ...