0

First time posting here, normally I am able to find an answer to my questions by searching but not this time...

I have a table T1 with 2 sets of coordinates (start_coord and end_coord) but where some location information (start_loc_name, start_loc_id / end_loc_name, end_loc_id) are empty. I created another table (T2) with a list of all DISTINCT locations that each have loc_coord.

Now I'm trying to update missing location information (loc_name and loc_id) in T1 based on a match with the coordinates in T2. The problem is when I run an UPDATE query it fails because several T1 records match one T2 record (which is normal). All of this is done in BigQuery.

Is there a way to do that simply without creating 2 JOIN tables (one for each coordinate set)?

Thanks a lot in advance!

Octave
  • 1
  • 1
    Welcome to SO, Octave! Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans May 14 '22 at 17:53
  • 1
    In addition to providing enough code so others can better understand or reproduce the problem, please either remove the `r` tag or explain how it is relevant to your question. – AlexK May 15 '22 at 01:11

0 Answers0