I am trying to calculate a running total in Microsoft Access and could really need some help. Basically I have the below table containing three columns: Item Inventory Position Multiple I need a …
Multiple Left Joins in Spark Dataframe with same table without Unique Column Error
I have a Main Dataframe – seasonsDF, Left-Joined with Key-Value DF – listvaluesDF, multiple times val seasonFinal1DF = seasonsDF.join(paletteDF, seasonsDF(“Palette”) === paletteDF(“id”), “left_outer”)…
Condition’s speed in query [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 Given both give the same result and from the same data. Does adding the co…
Query to Id referencing to an ‘Id’ to the same table
I have a table AMZ_EMPLOYEE_DETAILS with Employee Id, Employee Name and Supervisor1 and Supervisor 2. The Supervisors are employee itself but represented by their name. My task was to replace the Supervisor names with their Ids. I have used the following query to obtain the solution but it uses sub-queries an…
Reformatting multi-feature timeseries data with SQL
I have a table that has the following formatting: id | uid | created_at | feature | value 1, 1, 2019-10-1 20:26:32, ‘weight’, 155.0, 2, 1, 2019-10-1 23:26:32, ‘weight’, 150.0, 3, 1, 2019-10-2 10:00:…
SQL – joining 3 tables and choosing newest logged entry per id
I got rather complicated riddle to solve. So far I’m unlocky. I got 3 tables which I need to join to get the result. Most important is that I need highest h_id per p_id. h_id is uniqe entry in …
Query to return one result, but have a count of other field
I have multiple fields within my SQL table(Microsoft Access) and have created a form that will allow users to search for a serial number. This search should use the value of a text box to search one …
How to create index on records for last 90 days in Postgres Making now() immutable
I have a case where due to speed issues I only want to create the index on records for last 90 days. When I try to create index like this: create index if not exists …
SQL Server – Close external port and work as localhost when sql server and application are on the same server
My database and my web application are at the same server at the moment and I would like to access SQL Server as localhost and close the SQL Server port for remote connections. This is my current …
Concat rows for employee roles
I’m using SQL Server. Looking for similar functionality as GROUP_CONCAT or listagg functions provided in other Databases. Seems like STUFF function is provided to concat rows. Here’s my attempt. Employee Role EmployeeRole Expected Output Answer In SQLServer 2017, you can use aggregate function STR…