Select Multiple Columns in FLUX

In flux, what is the boilerplate query for producing an output table which has multiple fields as columns?

ie for a given bucket and measurement if I want to select fields x1,x2,x3, how do I do this?

1 Like

use pivot function. |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")

1 Like

More specifically,

what is the equivalent of the below InfluxQL code in influx 1 for FLUX in influx 2 :

SELECT “x1”, “x2”, “x3” FROM “db”.“measurement” WHERE time > :dashboardTime: AND time < :upperDashboardTime: