I have a function in MySQL that will select the time someone clocked in, and select the time someone clocked out and link them together. It will calculate how many hours that person has been on the clock in total between two provided dates. I then created another function that selects the break events and sub…
MySQL syntax for summing several count data
I have a MySQL table called things_they_own with two columns: person and thing and my primary key is the combination of the two. Thus, there are several rows where the first column is a certain person with the thing column being different for each, and several rows where the second column is a certain thing a…
What’s the most efficient way to divide a table by a threshold into two sub-queries in PostgreSQL
I have a table test with schema id(int) and height(numeric) in PostgreSQL. I need to divide them by a certain height then calculate each sub-query. To my understanding the two sub-query above will iterate the table twice. In a programming language such as python, i can put data in a list then just iterate thr…
How to get the intersection length of touching geometries with ST_Touches
I am trying to develop a query in Postgis, where it can solve this problem: I have a geometry and I wanna know which of the polygons that touches it, there is the highest contact area of this …
What is the difference in select with alias, and without- oracle 11g
I have a table, let’s name it table1. The table consists of many columns, and one of the columns is an object, which consist of 3 subcolumns, let’s call them value1, value2, value3. Let’s say that …
How to Merge Identical Rows with different column?
I have a table like this: ——————————————– | Job | Class | Employee | PayType | Hours | | 212 A John 1 20 | | 212 A John 2 …
Getting unknown column in on clause when trying to get the latest record
I have two tables orders and order_items I am trying to get the last order_sum for each day using an inner join but I am running into an error in my second join. Unknown column ‘o.last_order_date’ …
mysql gives a syntax error with many joins [closed]
it’s about an hour that I’m trying to understand why this query gives: syntax error near ‘WHERE players.player_user=1 AND players.player_status=0 GROUP BY players.playe’ on line 108 I have mysql 5.6….
How to distinct with condition
I am working on T-SQL. I got a table like this. x y z t 1 avc 45353 11.02.2019 2 avc 24324 29.05.2019 3 frg 54647 30.06.2019 3 dsc 35678 29.05.2019 4 dec 21445 13.04.2019 4 …
Problem in getting this output using Join in SQL Server
I want to show a output like this, +————+————–+———————+—————+———–+————–+———–+ | segment_id | segment_name …