@itob Once a value is written as a field, you can’t change it to a tag unless you rewrite the data to another database. To set a column as a tag with INTO, you need to include a GROUP BY clause and group by all the columns you want to write as tags.
Oh, I see. The tag doesn’t already exist. InfluxQL doesn’t let you set arbitrary columns values (ex: SELECT 'foo' as bar ...), so you won’t be able to do this with InfluxQL. If you’re using InfluxDB v1, I think the only option would be to query the data out, transform back into line protocol but include the new tag, then rewrite it back to InfluxDB, but in a new db or measurement.
If you’re using InfluxDB v1.8, it does support Flux, you just have to enable it. You could perform this type of operation with Flux. Flux requires time bounds on your query, so you may need to run this query in time-based batches if you have a lot of old data. The query itself would look something like this: