Hi!
I have the following query that is used to return records from three search boxes.
SELECT *
FROM {{truckLoadTracker.data}} a join {{regionsByOrigin.data}} b on a.[Origin LMH] = b.Location
WHERE
(
{{ !search.value }}
OR VIN ILIKE {{ '%' + search.value + '%' }}
)
AND (
{{ !locationSelect.value}}
OR [Current Location] ILIKE {{ "%" + locationSelect.value + "%" }}
)
AND (
{{ !regionSelect.value}}
OR b.Region ILIKE {{ "%" +regionSelect.value + "%" }}
)
The issue is that this is returning duplicate rows but I cant figure out the syntax to convert this to a left join correctly.