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
. - Change the
release_date
column type fromInt32
toDateTime
.
SELECT
VendorID, -- List column names (VendorID, trip_distance)
trip_distance, -- separated by commas.
fare_amount AS fare, -- You can use AS to rename columns
(total_amount/1000) AS total_amount_thousand_dollars, -- or give a name to any expression.
CAST(VendorID as Uint32) AS vendorID -- Use CAST to change data type.
FROM
`tutorial-analytics`
LIMIT 10
View the example in the right-hand section and click
Query results are available in the Result tab as a table or schema.