Mysql – SQL get rows where sum of col value is bigger than X
I have a table like this: id date capacity depot reserved order_id 1 2024-04-29 69 1 0 0 2 2024-04-29 49 1 0 0 3 2024-04-29 69 1 0 0 4 2024-04-29 69 1 0 0 Now I want to…
I have a table like this: id date capacity depot reserved order_id 1 2024-04-29 69 1 0 0 2 2024-04-29 49 1 0 0 3 2024-04-29 69 1 0 0 4 2024-04-29 69 1 0 0 Now I want to…
Today I have encountered an extremely counter-intuitive behavior of < operator in MySQL and I have no idea why. Specifying exactly the same operands for < gives different results depending on the contexts. Can anyone explain the reason? This is…
I am trying to docrize an application of spring boot which also utilizes a mysql db also Below is the docker file FROM maven:3.8.3-openjdk-17 AS build EXPOSE 8081 ADD /target/oks-0.0.1-SNAPSHOT.jar oks-0.0.1-SNAPSHOT.jar ENTRYPOINT ["java","-jar","oks-0.0.1-SNAPSHOT.jar"] The application-develop.properties is below spring.datasource.url=jdbc:mysql://localhosts:3306/oks?useUnicode=true&characterEncoding=utf8 spring.datasource.username=root spring.datasource.password…
I have the following table that I generate with a certain query: +-------------+------------------+ | error_codes | number_of_orders | +-------------+------------------+ | 2066 | 104 | | 5092 | 642 | +-------------+------------------+ I'd like to append the corresponding message for each and…
I have been trying to get the name of employees first name for all sales of the sales person with the most sales. I have tried these 2 solutions but none of them seems to work. (P.S. I will provide…
Is there a way to create a data source to Azure MySQL database in Google Data Studio? What is the public IP of Google Data studio that I can give access to in my Azure MySQL database? Thanks in advance!…
I have this query: SELECT u.id, u.service, u.subscription_date FROM user u WHERE EXISTS ( SELECT 1 FROM user u2 WHERE u2.subscription_date = u.subscription_date AND u2.service = u.service GROUP BY u2.service, u2.subscription_date HAVING COUNT(*) > 1 ); My issue is that…
i am creating a new backend APIs for the online shop, I have created entities class for item, cart, user etc. However, when I am running the app the tables are not getting created in the DB. I am not…
I have a columnn named pay_type with data_type : array string and I would like to query for when this column has duplicate values. Example: Table_Name: Finance Columns: customer_id,pay_type How can I query in mysql to return rows 1 and…
Select CONCAT ( Name, '(' , LEFT(occupation,1) , ')' ) FROM occupations UNION Select CONCAT ('There are a total of ', Count(Occupation) ,' ', occupation, 's' ) as line FROM occupations Group by occupation ORDER by line Why can I…