Data Looks Like Below – my desired output is that when the next entry in the day is the same value those times are combined to get a total time. Once a value changes, take the date of the first entry (…
Tag: sql
Unable to divide to counts of two separate lists in SQL, keeps returning 1
I have one list of events. One event name is creating an account and another is creating an account with Facebook. I am trying to see what percentage of accounts created use Facebook. The code below …
Add column with yesterday sale information on a daily sales database
I’m working with a database that contains daily sales information of different products and stores. StoreSku Date UnitsSale A-2134 20/04/2019 2 A-2135 20/04/2019 1 A-2134 …
Split comma separated values into multiple rows – Oracle SQL
I have a table table1 TEST_TYPE H_LEVEL HADOOP 22RETGGEDGDD, RRMMNFNEDGDD Control Directory 1 Interchange Control Header 22RETGGEDGDD, RRMMNFNEDGDD …
Sum in Laravel Eloquent and Return on Page
I’m trying to get the location’s inventory value with the following eloquent query. It properly pulls up everything (location name, address, # of users, etc) except the inventory value which returns …
Only returning one record in dataset
I am using ado .net in my web API and dapper and I have a function that checks the orders and the order lines it works fine if their only one order but if there an order without order lines it won’t …
How do I duplicate a column in a SQL Table?
I am using SQL Server 2014 and I have a table named Table1. Assuming I want to duplicate a column named SubCategory into a new column called SubCategory2 (with the same values as in column SubCategory)…
Querying a subset
I want to write an SQL query to find records which contain a particular column and from that subset want to find records which doesn’t contain a some other value. How do you write a query for that? …
Adding quotes into a sql query with Vba code
I can recover data from my database using vba, but I have to add quotes on the result of column (“value1”, “Value2”, “Value3” etc) But I do not know how to add quotes inside the SQL query, when using “…
select rows with events related with another events in the same query column
I need to select rows with EventTypeID = 19 which does not have related EventtypeID = 21 LoggedOn exactly 4 minutes earlier for the same EmployeeID. Here’s the query bellow and some raw output: …