I am performing a linq query to grab some data from the DB. Here is my linq: The main 2 tables I am concerned with here are JobRequest and JobRequestParameters… JobRequest table has 13 records (but not all jobs have parameters). JobRequestParameters table only has 4 records. They are joined on by PkJobR…
SQL: Query the same column 3 times with 3 different where clauses
Trying to show a table with 3 columns that are prices that need to be displayed. the columns are differentiated by ‘price_type’ and there are 3 different price types. Its probably something obvious …
How to get time difference Duration totals grouped by Name and when Value changes in certain way?
I’m looking for the Sum of time value differences between rows where Value was initially 1 and is now 0, grouped by Name. Example data for a single Name, but there are many different Names in the real data. This data should return 11 minutes for Row 9–>7 transition and 5 minutes for Row 4–…
SUM of TotalSellPrice, Grouped by JobID? – Beginner SQL Question
I’m looking to write a query that gives the YTD sales for each job within our system. We use Bistrack. Here is what I have: select C.Shortname AS “Customer”, J.JobReference, (OH.TotalSellPrice – OH….
SQL insert choice of column name dependant on select value
Hope the title is a reasonable description. I have 2 tables in a db (sqlite). CREATE TABLE files ( name TEXT, sha256 TEXT, fsno INT ); CREATE TABLE sha256 ( sha256 TEXT, fs1 INT, fs2 …
How to sum COUNT values
I’m very new to SQLite so please forgive me asking something stupid. From a database with a table containing aircraft data I can count the records with data from a manufacturer with my existing query: …
Is it possible to select multiple offsets with SQL
I’d like to select multiple offsets with a single SELECT SQL query. Is this possible? For example, let’s say I have a table of non-continuous dates called dates. I’d like to select the 1st, 4th and 7th offsets from the most recent date. In this example, the query should return: Ideally, I wo…
MySQL: get total number of employees in each department
I am new to MySQL and Have following question. Let’s say I have two following tables Departments DepartmentId Name Employees ID DepartmentId Name I have written following query which is …
SAS proc sql – is this the correct usage?
This works but wanted a health check as to if i have done this correct with proc sql connect to i.e do i need to have separate “select * from connection to’s”? Thanks Answer Since you are pulling from the same database just push the join into the database. While you are at it assign names to…
Why store whole records in audit tables?
I worked in several companies and in each of them audit tables have been storing full snapshots of records for every change. To my understanding it’s enough to store only changed columns to recreate record in any given point of time. It will obviously reduce storage space. Moreover I suppose it would im…