Skip to content
Thibaut Barrère edited this page May 13, 2020 · 6 revisions

⚠️ This document is a draft

A common requirement during ETL work is to search a SQL column for a given (unique) value, find the corresponding row, then get the value of a second column in that same row. This can be very valuable to:

  • Replace a given business key by the corresponding surrogate key (see wikipedia page on surrogate keys) in e.g. a data warehouse.
  • Help handle relationships between tables during migrations between databases (e.g. one could keep a legacy_id in a new product table, then an invoice line item referring to the legacy_id can easily replace that id with the new target id)

Kiba Pro `SQL