Skip to content
Advertisement

Combine SQL queries with different WHERE causes

I have written a database with game stats, featuring winner, loser, and money won. I’m now trying to make stats for it. See database here I’m trying to make stats for these games, etc number of wins/…

Get users that made order every month from MySQL

This is my database table: orders id user_id order_id datetime 1 1 1245652 1607444387 2 2 3265784 1607357987 3 1 9521014 1607357927 4 3 1036951 1607317987 I want to have a list of users that …

Polly retry policy with sql holding transaction open

I am using Polly to implement a retry policy for transient SQL errors. The issue is I need to wrap my db calls up in a transaction (because if any one fails, I want to rollback). This was easy before I implemented retry from Polly because I would just catch the exception and rollback. However, I am now using the

SQL statement in VBA Excel

I have a problem with a SQL Statement in VBA Excel. I can’t use ORDER BY together with GROUP BY and I don’t understand why. If I delete ORDER BY I don’t get errors. Can anyone help me figure out where am I wrong? Thanks a lot to everyone!! Here is my code: Answer missing space ? try with

SQL Sorted Count

I have the following table sorted by date: date id 9/1/20 1 9/1/20 2 9/3/20 1 9/4/20 3 9/4/20 2 9/6/20 1 I’d like to add a count column for each id so that the first count for each id is the earliest date and latest date would receive the highest count for each id: date id count 9/1/20 1

AVG in SQL Server

I am learning SQL Server, and I have a sample database which I got from my co-worker. I created a stored procedure previously which works fine. Now I am trying to show average of the column which I am struggling at the moment. Your supports means a lot and I will learn from this. So here is my query: And

Advertisement