I have a bunch of calculations in a SQL Server 2012 query, kind of like: select T1_month ,a.some_value, b.value_to_compare,(select (some_value – value_to_compare)/value_to_compare*100 where …
VBA SQL update/insert to local table using values from form
I am trying to update a row in a local table stored in access (or insert a new row if that ID doesn’t already exist) using values populated in a form by the user. I am writing it in VBA using SQL. …
Count distinct values in ColumnA for each unique value in ColumnB
I have a table of shipment numbers (can be duplicate) and a concatenated field of their origin – destination (can be duplicate). I have a select column that selects all of the origin-destinations for …
How to display the name of a supervisor for a certain worker MYSQL
Display the name of McLester’s supervisor. Using standard syntax select sup.lastname “Supervisor’s Name” from staff e, staff sup where e.supervisorno = sup.staffno and lastname = ‘McLester’; Here is …
NULL behavior with Comoperator like ALL in Oracle SQL
https://oracle-base.com/articles/misc/all-any-some-comparison-conditions-in-sql Query 1 : Nothing is coming. But for below quesry. All records are coming while subquesry is returning is NULL same as like above query (SELECT NULL FROM DUAL ) Query 2: Please explain me why Query 1 is returning No Records but Qu…
Capturing year of a DATE in SQL Worksheet (Datameer)
In Datameer, how do you capture the year of a DATE column in a SQL worksheet? This query SELECT YEAR(rslt_part.draw_date) AS YEAR, COUNT(*) AS CT FROM rslt_part GROUP BY YEAR is returning the …
SQL query assigment
1) Query that returns all agents who had sales greater or equal than 20 in month March, also sum of sales in month March greater or equal than 20 and number of sales in month March greater or equal …
Using select distinct with sum
I am not sure if what I want can be done but basically, I have a homework where I am supposed to come up with sql statements to filter through a database of a made up TCM company in any way. I wanted …
Using generate_serires with partition by generate triple duplicate row
I have a table which look like this: dt type —————————– 2019-07-01 10:00:00 A 2019-07-01 10:15:00 A 2019-07-01 11:00:00 A 2019-07-01 08:30:00 …
SQL Return last record where column value changed and amount of change
In MS SQL 2012, I have a table like such: Key | Entity | Value | DateTime ———————————————————– 10 A 800 …