Linked Questions

1 vote
3 answers
1k views

I have two tables as follows: TABLE A | id | col_a | col_b | user_id | -------------------------------- | 1 | false | true | 1 | | 2 | false | true | 2 | | 3 | true | true | 2 ...
hero121's user avatar
  • 121
1 vote
4 answers
871 views

| col 1 | col 2 | col 3 | |-------|-------|-------| | 67458 | ADM | 1008 | | 67458 | ADM | 1009 | | 67458 | SKI | 1009 | | 67458 | LIS | 1010 | | 67458 | TOU | 1121 | How to get max ...
CodeOverFlow6811's user avatar
1 vote
2 answers
995 views

I have a table below with sample data. Date&Time Message 13/07/2022 8:59:09 Normal 13/07/2022 8:59:10 Normal 13/07/2022 8:59:11 Normal 13/07/2022 8:59:12 Warning 13/07/2022 8:59:13 Warning 13/07/...
RKIDEV's user avatar
  • 347
2 votes
3 answers
264 views

I have a table of orders with a column denoting whether it's a buy or a sell, with the rows typically ordered by timestamp. What I'd like to do is operate on groups of consecutive buys, plus their ...
Alex's user avatar
  • 21
1 vote
1 answer
1k views

I have several tracked specimens that can move between different areas throughout the day (and its periods). In the example below the calculated field mov has to restart counting whenever there is a ...
Antonio's user avatar
  • 773
2 votes
1 answer
1k views

I am trying to get an array of categories associated with each product and then also get the top-level parent category of each product in another column, which by my logic is finding the same values ...
Cole's user avatar
  • 127
0 votes
1 answer
728 views

product table product_id name 1 t-shirt 2 shirt users table user_id name 1 sphinx favorite table with a UNIQUE constraint on (user_id, product_id): user_id product_id 1 2 What is best way to query ...
Omar khaled's user avatar
0 votes
1 answer
924 views

How to get a continuous date interval from rows fulfilling specific condition? I have a table of employees states with 2 types of user_position. The interval is continuous if the next higher ...
Toerto's user avatar
  • 21
1 vote
1 answer
688 views

I'm using Postgres 9.4 and I have 3 tables: truck , container and container_metadata. A truck can have many container and a container many container_metadata. I'll add more description later with the ...
muffin's user avatar
  • 2,124
1 vote
2 answers
587 views

I have a simple table tableA in PostgreSQL 13 that contains a time series of event counts. In stylized form it looks something like this: event_count sys_timestamp 100 167877672772 ...
Peter K.'s user avatar
  • 597
4 votes
3 answers
309 views

In a PostgreSQL 9.5.3 DB, I have a credit_card_balances table referencing a persons table which tracks the balances of various credit cards associated to a particular person: CREATE TABLE persons ( ...
ira's user avatar
  • 755
1 vote
1 answer
627 views

Let's say I have 2 tables: table device is a set of measuring devices, table data is a set of values of different types measured by the devices. Table data = (no, id,value_type,value, dayhour) no is ...
user3851205's user avatar
1 vote
2 answers
582 views

I have a table named tc_fuel that is receiving all the fuel related data from GPS vehicles, and I want to get the last "Tank Usage" to calculate MPG for a whole tank, but the readings when the tank is ...
RonEskinder's user avatar
0 votes
1 answer
505 views

I have a table which has devices with 3 statuses, Pass, Fail and Warning. Device Status Date Device1 Pass 12/1/2020 Device2 Fail 12/1/2020 Device3 Warning 12/1/2020 Device1 Fail 12/2/2020 Device2 ...
Ash's user avatar
  • 64
0 votes
1 answer
509 views

I have 3 tables: TABLE: session_log user_id | device | logged_on ---------|--------|--------------------- 1 | web | 2022-01-01 12:43:25 1 | web | 2022-01-01 13:33:32 2 | ...
user3842536's user avatar

15 30 50 per page
1 2
3
4 5
7