Home > Back-end >  i've been trying run a query using join function in sql and the result shows 'bikeshare_tr
i've been trying run a query using join function in sql and the result shows 'bikeshare_tr

Time:11-08

im trying to join data together using the join function on SQL and every time i run my query it shows error and the error says according to the data im using right now, it says 'bikeshare_trips' is not qualified with the dataset (e.g data table )

i checked for the data in the dataset and its there so i dont really understand what the error mean. and also check for any mistakes in my query and run it again but still the same result. and the link to my query is gonna be placed in case anyone wants to check it out. https://console.cloud.google.com/bigquery?sq=740828604161:fd77df6d30144ae5ab39070c0d68d6a1

CodePudding user response:

the error actually tells you your mistake. You need to specify the complete dataset name, i.e.

bigquery-public-data.austin_bikeshare.bikeshare_trips

CodePudding user response:

Looks like you forgot to mention bigquery-public-data.austin_bikeshare. to the trips table. Here is the query running with the complete dataset mentioned.

SELECT bs.name, bs.status, bs.modified_date,
bt.trip_id, bt.subscriber_type, --bt.biked, 
bt.duration_minutes
  FROM `bigquery-public-data.austin_bikeshare.bikeshare_stations` AS bs
  JOIN `bigquery-public-data.austin_bikeshare.bikeshare_trips` AS bt 
  ON bs.station_id = bt.start_station_id
  •  Tags:  
  • sql
  • Related