I need help converting this WHERE query into JOIN. I will be following the same pattern for other queries. Thank you. $query = “SELECT DISTINCT r.recipe_id, r.recipe_name, r.recipe_image, …
Wrong Duration after Formatting DATEDIFF Output (Extra Day)
I need to get the duration between two points in time, and it’s needed in the format “DD HH:mm:ss”. So, I used the following line: FORMAT(CAST(CONVERT(varchar(20), DATEADD(SECOND, DATEDIFF(…
Query for R Machine Learning Services – Filtering Categories in Where Clause
I am trying to run a query in SQL Server using the Machine Learning Services extension. So this is the problem I am having; DECLARE @query NVARCHAR(MAX) = ‘ SELECT CATEGORY1,CATEGORY2 FROM TABLE WHERE …
dynamic rolling average in sql
Hope I can explain this properly I’m trying to calculate a rolling average, but with a variable number of preceding rows, depending on a rolling sum of another column. Or in other words, I want to …
No value given for one or more required parameters adodb access error
I am trying to assign archival id in my database to the corresponding file number column through an Excel userform. It should find the largest alphanumeric string in the column, and increment it by 1 …
SQL frame a result table from a table by searching its field
I have a table as below. MyTabl Name Main Group3 Xyz Group2 Group3 ABC Group1 Group3 PQR – Group3 I need to frame the result table with the fields. “Name”, “…
How to properly store a file location to a postgresql table?
I am very new to postgresql. I don’t plan to study it fully in-depth right now as I have other priority topics to finish. But now I need to know some basics of postgresql for the perfect completion of …
Combining columns into records for WHERE IN()
First, I am sorry. I do not have control to change how the data is stored, so I have to work with it the way it is. I have some tables in a Pervasive database that looks like this: Records: id | …
Matching based on whether year is included (at all) in date range
I am attempting to join two tables based on date ranges. Table A format is: ID CAT DATE_START DATE_END 1 10 2018-01-01 2020-12-31 2 15 2018-06-01 2018-07-01 Table B format …
EF Core Insert operation – how does the SQL command work?
How does the following SQL command works? exec sp_executesql N’SET NOCOUNT ON; DECLARE @inserted0 TABLE ([Id] int, [_Position] [int]); MERGE [OrderLine] USING ( VALUES (@p1, @p2, 0), (@p3, @p4, 1), (@…