Insert-or-Update Preview
Before applying the load, show the action for the freshest version of each src_id from stg_users: freshness is determined by the greatest loaded_at, with larger id breaking ties. If the key is not in dim_users, action is INSERT; if it is already there, action is UPDATE. Return src_id and action, sorted by src_id.
Przykładowy oczekiwany wynik
Tak wygląda poprawna odpowiedź — liczba jej wierszy jest swoista i nie musi odpowiadać tabelom ze schematu.
| action | src_id |
|---|---|
| UPDATE | 101 |
| UPDATE | 102 |
| INSERT | 103 |
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj się