I am trying to insert large amount of data from one table from PROD DB to table in Archive DB. Tables are with the identical schema and archive table is with drooped indexes and “Identity insert on”. …
Counting the number of words in a Column in Oracle SQL
How do you group this data, based on Patterns? Is it possible in SQL? CREATE TABLE ABC (“NAMES” VARCHAR2(50 BYTE)) ` `INSERT INTO ABC (names) VALUES (‘CA Apple 3’); INSERT INTO ABC (names) VALUES (…
My custom order by in criteria query/jpql
Is it possible to do my custom order by using criteria query or jpql in Java? In my table, I have a column – number type(for now, this column includes numbers such as 1, 2, 3, 5, 10). I would like to sort result in this order 2, 5, 1, 10, 3. How can I do it? Answer You have
Combine date ranges for rows with same value
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 (…
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)…