Skip to content

Commit

Permalink
refactor: specify selected columns in final query for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasEvilasio authored Oct 8, 2024
1 parent 99e31de commit 1138d71
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions queries/models/utils/pedido_n_placas_antes_depois.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ loc AS (
)

SELECT
b.*,
b.placa,
b.tipoveiculo,
b.velocidade,
b.datahora_local,
b.camera_numero,
b.empresa,
COALESCE(b.latitude, l.latitude) AS latitude,
COALESCE(b.longitude, l.longitude) AS longitude,
b.datahora_captura,
b.row_num,
l.locequip,
l.bairro,
COALESCE(b.latitude, l.latitude) AS latitude,
COALESCE(b.longitude, l.longitude) AS longitude
FROM before_and_after b
LEFT JOIN loc l
ON b.camera_numero = l.camera_numero
Expand Down

0 comments on commit 1138d71

Please sign in to comment.