I need to find first document open date for request. For every request first step is opening a document and then it can be denied or accepted multiple times. I need to find first open_date between …
Speeding Up Access 2016 Query
I have a query that contains amongst other things batsmanIDs and League names (extract below). I have put together another query to return all records where a batsman has played in each of two Leagues. The query works but it is very, very slow. There are 48,000 records returned in the first query but when I u…
Delete all related rows to user using EF .NET CORE
I have little problem with data delete. Let s assume that I have to delete user and all related rows to this user. I wrote some code in c#, but it takes ages to complete. Here is my some of my code. …
How do I select a Left Join based on a condition
I’m trying to run a left join based on a condition in a SQL Server database. Here’s the code: DECLARE @DB as nvarchar(25) $DB = ‘db1’ –I can just reset this from time to time SELECT h.name, h….
Get the latest full week’s data for analysis in SQL
I was given sales data, where I have items and sales on a particular date. Now, the company wants to analyze the latest full week’s data against the total sales of company. Item date …
Foreign and Primary Key Conceptual Questions
I am a newbie at SQL/PostgreSQL, and I had a conceptual question about foreign keys and keys in general: Let’s say I have two tables: Table A and Table B. A has a bunch of columns, two of which are A.id, A.seq. The primary key is btree(A.id, A.seq) and it has a foreign key constraint that A.id reference…
Using arithmetic operators and/or brackets in a LIMIT clause
I have the following small subquery in query in stored procedure. But there is the syntax error: “(” is not valid at this position, expecting an identifier So, the question is: do I have a possibility to use brackets and/or arithmetic operators in LIMIT clause? Documentation says I can use local v…
Add datetime column with values based on another datetime column
I have a table: Using SQL language (BigQuery dialect) I need to add one column date_today_max, such that it copies all data from date column, but for records with the latest date (meaning max(date)) it will replace date with current_date: with Python+Pandas I’d achieve similar with but I have no clue ho…
SQL Select only last row’s username
I got my db and I only want to get my last row’s username. The database is named servers and the table is log: As I mentioned I’m trying to get this: Output: borat I tried using: But I’m only getting the correct timestamp and not the right username, and my output is also way longer than what…
Issue with uploading image using this.form.submit();
I am using this.form.submit(); in order to upload an image straight after it is sellected and also pass some other info along. I am having an issue, the submit works and passes the id with post but the image is not uploaded and the name is not inserted in the db it might add a name like 0_ but that