Imagine i have a table like below: ID Score someOtherColumns 1 1 …. 2 1 ….. 3 4 …. 5 2 …. 6 1 …. where score can have an intger …
Tag: sql
SQL query to sort data while insert , first numbers then alphabets an last symbols
I am getting trouble to write SQL sort Query, I have table as follows And I want to sort above data as, First should number and then alphabets and last special symbols like following table. First …
SQL select the min and max values of the intersecting interval
In MsSQL 2014 I`ve got a table containing intervals of values Col1 Col2 1 3 2 4 7 12 7 15 14 21 I need to get the maximum and minimum values of the intersecting …
oracle sql find overlapping values between two sets
I have two tables (‘stock’, ‘website’) have the same structure both has one called ‘product_id’ I want to find out in what percentage the product_id in the ‘website’ table also in ‘stock’ table Did …
SQL Trigger throws error but still inserts
I am working on a trigger that is supposed to block an insert when @verkoperstatus is 0; this does function, but for some reason it also stops the insert when @verkoperstatus is 1. What could be the …
Execute two UPDATEs on complementary data at once in Oracle
I have the following table that I need to update: USER: | ID | ACTIVE | REF_COL | COL_2 | COL_3 | |—-|——–|———|——-|——-| | 1 | 1 | value | value | value | | 2 | 0 | …
MS SQL : Need to get row wise value from cell for similar rows, Code not working correctly
I have 100s of excel sheets(CSV files) I need to use for the historical load. I am going to load all the CSVs to a stage table using ETL. I am trying to get the row-wise value from the cell for …
How to fix slow running SSIS package
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