SELECT Manufacturer_Name FROM DIM_MANUFACTURER INNER JOIN DIM_MODEL ON DIM_MANUFACTURER.IDManufacturer = DIM_MODEL.IDManufacturer WHERE DIM_MANUFACTURER.IDManufacturer IN ( …
Trying to convert SQL getdate into varchar with no in-between characters
I have a list of auto-generated tables in MS-SQLServer that differ only in the date listed at the end of the name. The challenge is that I want to create a script that always references a table ‘x …
How do you update multiple rows in one column in a query?
In my table I have a column called test3 which has 8 rows in it, values ranging from 6 to 9, I am trying to use an UPDATE statement in SQL to update all of the rows in test3 but it doesn’t seem to …
Find unique subset
I’m trying to query 4 columns A, B, C and D to find records where there is more than 1 D per A/B. Relationship is hierarchical from A to D; there can be multiple Ds per C, multiple Cs per B etc. e.g. …
Failed to add the foreign key constraint. Missing index for constraint * in the referenced table *
system info SHOW VARIABLES LIKE “%version%”; when i create table in database with following statements it sucked. CREATE TABLE flavors ( created_at DATETIME, updated_at DATETIME, …
Does DB2 implement multi-table indexes?
I’m afraid this functionality may not exist [yet]. I wanted to use an index that spans multiple tables in DB2. I know Oracle and SQL server implement them (with more or less options) and that …
Randomly flagging records in an Oracle Table
Given a table of IDs in an Oracle database, what is the best method to randomly flag (x) percent of them? In the example below, I am randomly flagging 20% of all records. ID ELIG 1 0 2 0 3 0 4 …
Dynamically Generate SQL for Logical Sentence
Super tricky question. I have a client wanting to output true/false based on a string sentence that represents a rule. E.g. if a rule is the string: “56 AND 78”, then this means “Return …
Is there any way i can populate entity based on months but excluding the first month each loops?
i have a set of data sample like this | id | month | x | jan | x | feb | x | mar is there any way i can populate that sample to be like this? | id | month | number | x | jan | 1 | x | feb | …
How to aggregate multiple arrays in Azure Stream Analytics
I have a table that looks like this: “A” : [1,2,3], “A” : [4,5,6], “A” : [7,8,9], “B” : [10,11,12] “B” : [13,14,15] “B” : [16,17,18] and i …