Skip to content

Tag: recursive-query

Sql server Balance Table Update Recursive

I Have a SQL Server database with a table named Balance The table: Id Date IN OUT Balance 3345312 2022-08-07 100 50 250 5435245 2022-08-06 50 50 200 4353451 2022-08-05 0 100 200 5762454 2022-08-04 20 100 300 7634523 2022-08-03 400 100 380 5623456 2022-08-02 100 20 80 4524354 2022-08-01 0 0 0 Id = Unique Ident…

Recursive SQL query for finding matches

I have 5 SQL Tables with the following columns: As input data I have employee_id and request_id. I need to figure out whether the employee has access to the request (whether he’s a manager or not) We cannot use ORM here since app’s responsiveness is our priority and the script might be called a lo…