How to find the last non-null value from an account that is closed currently? [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I am trying to figure out how I can retrieve the last balance of an account that is now closed so I can see how much money was left in their account before they closed it. I am trying to figure out how to write a SQL query for this. I have a table called Accounts that has the following columns: AccountNumber,Balance,Production Date,ClosedDate,Balance . I'm not sure how I can go back into time and retrieve users balances in their accounts while also pulling the same ones that are now closed. Any ideas?!
I haven't tried much because everything has failed currently. I'm thinking some type of CTE clause might do it?!

Related

Amazon API that would allow bulk order without manually entering all information [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I have hundreds of employees that I would like to gift them with items purchased on Amazon. It would be convenient for me to place orders for those gifts directly from my CRM without manually entering the information just using an API.
Would be thankful for a lead.
I did some websearch but not much to be found out there

The database is red-lined. How to fix the error? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 16 days ago.
This post was edited and submitted for review 13 days ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
From the page Move a table from one database to another database SQL Server, I got the way to copy a table from the database, TIMS, to another database, PUBS, as follows.
select * into pubs.course from tims.[dbo].[course]
However, pubs was red-lined with an error message
The specified schema name "pubs" either does not exist or you do not have permission to use it.
I have got the problem fixed. Thus no need to update my qestion.

Cleaning data in SQL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 days ago.
Improve this question
I want to clean this data. There are text strings for dates and user_ids. Every date from the rows is assigned for every id. How do we do this using SQL?
enter image description here schedules table
I don't know yet. I am expecting every date from the rows is assigned for every id.

How to know the number of user that register every day POSTGRESQL [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I would like to know how many users register every day.
But i don't have any idea how to make that.
You can find below the table.
You use group by, assuming that "register" is defined by the created_at column:
select created_at::date, count(*) as num_created_users
from users
group by created_at::date;

SQL showing the results of two queries [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have two tables. Customers and Employees and I want a query that displays all customers and employees who live in California.
How would I go about doing that?
Take a look at the UNION https://www.w3schools.com/sql/sql_union.asp. Be aware that when SELECT-ing both have to have selected the same amount of columns.