Skip to content
Advertisement

Tag: sql

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

Get XY coordinates from GEOM_SEGMENT_START_PT() output

Oracle 18c: How can I get the X & Y coordinates from GEOM_SEGMENT_START_PT()’s resulting LRS point? Note: The coordinates are stored in the SDO_ORDINATE_ARRAY( ), not the SDO_POINT. Desired output: Normally, I’d use something like a.shape.sdo_point.x. But I don’t think that applies here since the coordinates aren’t stored in the SDO_POINT. Related: Oracle Spatial Community – Get X & Y

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 different lengths, as it could be ABC_UK, ABC_CHR or ABC_I

MS Access – How to properly use Pass-Through queries as source for form

In my MS Access FrontEnd connected to an SQL Server, I’m using a combination of pass-through queries and “normal” ODBC connection via file-DSN (for “easy bound forms”) for my forms. Within VBA functions and Subs I use some ADO connections to directly change data in the tables. I need pass-through queries for some forms as I need to use DISTINCT

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 typical approach here is to aggregate the rows per instance and use conditional aggregation in the

SQL Trigger for updating values from a query by id

I have three tables: employee with id(employee id), numOfTickets tickets with date, asset(id) and some more fields control with id(employee id), asset(id) when a new ticket is created it automatically inserts a row into tickets and control. Now I want to create a Trigger or something similar to automatically update the number of open tickets for each employee. A Query

Advertisement