Selecting data from specific columns
You can fetch data from all columns as well as from their their subsets. You can also rename existing columns and create new ones.
For example:
- Select data from the
age
,last_visit_time
, andregion
columns. - Rename
region
toarea
. - Update the
release_date
column type fromInt32
toDateTime
SELECT
VendorID, -- Column names (VendorID, trip_distance)
trip_distance, -- are separated by commas.
fare_amount AS fare, -- Using AS, you can rename columns
(total_amount/1000) AS total_amount_thousand_dollars, -- or name an arbitrary expression,
CAST(VendorID as Uint32) AS vendorID -- using CAST, you can update the data type.
FROM
`tutorial-analytics`
LIMIT 10
Take a look at the example on the right and click
Query results are available in the Result tab as a table or schema.