I have an example of code from Qlik documentation doc:
EventLog:
LOAD * Inline [
Time, Event, Comment
00:00, 0, Start of shift 1
01:18, 1, Line stop
02:23, 2, Line restart 50%
04:15, 3, Line speed 100%
08:00, 4, Start of shift 2
11:43, 5, End of production
];
OrderLog:
LOAD * INLINE [
Start, End, Order
01:00, 03:35, A
02:30, 07:58, B
03:04, 10:27, C
07:23, 11:43, D
];
//Link the field Time to the time intervals defined by the fields Start and End.
Inner Join IntervalMatch ( Time )
LOAD Start, End
Resident OrderLog;
As you can see there are two tables EventLog and OrderLog. The result of this operation is
| Time | Start | End | Order |
|---|---|---|---|
| 00:00 | - | - | - |
| 01:18 | 01:00 | 03:35 | A |
| 02:23 | 01:00 | 03:35 | A |
| 04:15 | 02:30 | 07:58 | B |
| 04:15 | 03:04 | 10:27 | C |
| 08:00 | 03:04 | 10:27 | C |
| 08:00 | 07:23 | 11:43 | D |
| 11:43 | 07:23 | 11:43 | D |
Now I have such a thing Some_table1 has many column and specific col1 column. There is Some_table2 that has for example start_ and end_ columns. From this code:
Some_table1: //has col1 column
//Loads etc.
INTERVAL_MATCH:
IntervalMatch (col1)
LOAD DISTINCT
start_
,end_
RESIDENT Some_table2;
how can I achieve it in Amazon SQL (based on postgresql)? Is there any built-in function or do I have to use some kind of a JOIN?