DB-Fiddle CREATE TABLE logistics ( id int auto_increment primary key, campaign VARCHAR(255), process_status VARCHAR(255), delivery_type VARCHAR(255), quantity INT ); INSERT INTO …
Joining table get the first data on first table if duplicate
Hi i have table1 and table2. table1 is the logtime table of employees and table2 is the groupcode of the employee. On table1 some employees has duplicate time in because they time in multiple time …
Get all Many:Many relationships from reference/join-table
I am having difficulty querying for possible relationships in a Many:Many scenario. I present my schema: What I do know how to query with this schema is: All Bands that a given User belongs to. All …
GROUP BY with nested case expression – is there better way?
SQL server 2012 I am taking fees received and multiplying them by different factors based on how long the Client has been a Client. The group by clause is fairly straight forward. However, my select gets awkward when I want to use this criteria in different ways: I suppose I should mention this is a simplifie…
How to extract text between two words in Oracle
This is the source string: random foobar “name” : “Jack Ryan”, other random stuff In Oracle query, how do I extract Jack Ryan from it? I guess I am looking for whatever is between “name” : ” and “,…
Aggregating data with SQL if other values in rows meet certain criteria
I’m pretty new to SQL and am trying to figure out if there’s a way to aggregate the date into new column. For instance, below is a sample set of date. I want to take all the type ‘2’ and create new …
Comparing substrings in two columns across tables in sqlite
I’m using Python and trying to compare two tables in SQL and match them by partial country names. So far I’ve gotten country names that match exactly. I’m running into an issue trying to get partial …
SSIS Script C# Script Task to Add current date to a file using a variable
Im have this script to add current year month to a file in a directory. It works perfect with the directory path, but I want to change the directory patch for a variable, because every month its going …
IBM Maximo Where Clause
I am trying to create a where clause to return all work orders between set dates where the there are no ACTUALS recorded (no labtrans). I have an existing WC which i am using as a template for this one but i am stuck with the “where” element. Many Thanks, G Answer The easy way, trusting that the r…
SSIS import an excel file with multiple header rows
Newbie doing SSIS import of csv and excel files. Things have been going well until I ran into an excel file with multiple header rows. The number of rows between the headers varies. I only need to …