I have this Standard SQL query: With the following output: You can simulate the output with: I am retreiving the entries of the last 12 months. I have already grouped and ordered them by month, but I need to also group them three by three according to the month. Moreover, as you can see in the output there ar…
Sql server map action to state to get the right result
For a database I need to log a state from the action of a different table. Table 1 ID Action 1 Accept 2 Save 3 Withdraw 4 Accept Table 2 ID State 1 2 3 4 Result Table 2 ID State 1 …
SQL – Period range in subgroups of a group by
I have the following dataset: A B C 1 John 2018-08-14 1 John 2018-08-20 1 John 2018-09-03 2 John 2018-11-13 2 John 2018-12-11 2 John 2018-12-12 1 John 2020-01-20 1 John 2020-01-21 3 John …
Compare two Count() values sql
I have a table called “Takes” that has the following information. Takes(stud_id, class_id, sec_id, semester, year, grade) I wanted to find the id’s of the students who took more classes in …
Cannot connect to database stored on aws from Heroku or Replit websites. (mysql2, node.js)
Problem: My discord.js bot isn’t connecting to the mysql database on aws. The bot is being hosted on replit and also on heroku but for some reason I can’t connect to both. I have tried connecting to the database from my laptop and it worked fine, I even hosted the bot on my laptop to see if there …
Typeorm MINUS operator
I’m trying to do a set difference in SQL. I’ve discovered the MINUS operator, which seems to do exactly what I need: https://www.geeksforgeeks.org/sql-minus-operator/ I’m trying to figure out if there’s a way to use this operator via typeorm. I’m currently using connection.getRep…
join tables from different databases only adding most recent date SQL
I am joining lots of data to handle dynamic/complex querying. The following is just a part of what I’m doing. I found a solution, then I think I tweaked it and lost it. Database Structure: oauth.users order.orders ( I know bad naming, I didn’t create the database) (customer_id = user.id) I want to…
Does Oracle 19 database support UUID columns?
Does Oracle 19 database support UUID columns, to store for example 123e4567-e89b-12d3-a456-426614174000? I know that Oracle NoSQL supports this, but I’m looking for Oracle SQL. If not how should I …
Mikro-ORM: error: there is no parameter $1
Alright so I’ve been trying to search Mikro-ORM’s docs to find how to pass in native sql query params in but I haven’t been able to find anything. After playing with the code a bit this is what it looks like which I think is sort of right but I’m getting this error My code currently lo…
What do I do to user data that is currently not verified?
Good day, I’m new to backend coding. What do I do to user data that did not confirm verification code from email during registration? Should I save it to database forever or do I have to delete it after a set of limited time when verified boolean is not met? I’m sorry if this is so beginner questi…