Skip to content

MariaDB : an INSERT…SELECT with empty VALUES too

I want insert data from another incomplete table, so some values must be empty in NOT NULL fields. For example, I have two tables : people and peopleTemp. In people table, I have a lot of fields : permit_number, first_name, last_name, gender, tel, etc. In peopleTemp table, I have only permit_number, first_nam…

C# SQLConnection.Open() hangs, with no exception

I am using C# in Visual Studio 2019, with Xamarin.Forms, and SQl in SSMS 2018 and have the below code (where [] is used to replace unneccessary information) When I run this, it hangs indefinitely at connection.Open(). Debug mode continues to run and appears to move on from Connection.Open(), but never reaches…

Group rows by datediff and then use diff function

I have table in PostgreSQL with timestamp column created_at and integer column user_id. Each row represents some action from user. I need to calculate average user session length. Session is defined as group of actions with time difference less than 10 minutes. When there is difference 10 minutes or more betw…

Return Most Recent Record group by 2 ID fields

I need to display the current status of a part (‘approved’ or ‘not approved’) I am setting up the status table as MaterialNo, ToolID, Status, Asofdate the idea is I may have several tools approved and several not approved. I want to be able to see the most recent status for each tool b…

How to select count between start to (start+length) [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 2 years ago. Improve this question How the following result appears when creating a table as above. This is the result of count…