Skip to content

SQL add values of different rows with same ID

Query: results in code duration 234 3 345 2 345 3 456 4 567 5 567 6 567 1 I would like to add the durations of the same code and display results as here code duration 234 3 345 5 456 4 567 12 but I don’t know where to start with this query? Answer You can use GROUP

Find position of first number in string and split

I am attempting to find the first numeric character in an ID composed of a client segment identifier (ABC_), a geographic identifier (UK) and a number (1234567). The ID will without exception follow this logic: ABC_UK1234567 From this, I need to extract the number only (the location identifier will have diffe…

SQL select items grouped by multiple values

I have table similar this one instance value type ins_1 31 “A” ins_1 81 “B” ins_2 72 “A” ins_3 9 “B” ins_3 9 “C” … and I need select only instance(s) which has double type (A,B). The expected result will be: [“ins1”]. Answer The typ…